Class ViewsResource
java.lang.Object
org.graylog2.shared.rest.resources.RestResource
org.graylog.plugins.views.search.rest.ViewsResource
- All Implemented Interfaces:
PluginRestResource
@Path("/views")
@Produces("application/json")
@RequiresAuthentication
public class ViewsResource
extends RestResource
implements PluginRestResource
-
Field Summary
Fields inherited from class org.graylog2.shared.rest.resources.RestResource
configuration, userService
-
Constructor Summary
ConstructorDescriptionViewsResource
(ViewService dbService, StartPageService startPageService, RecentActivityService recentActivityService, ClusterEventBus clusterEventBus, SearchDomain searchDomain, Map<String, ViewResolver> viewResolvers, SearchFilterVisibilityChecker searchFilterVisibilityChecker, ReferencedSearchFiltersHelper referencedSearchFiltersHelper, AuditEventSender auditEventSender, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
bulkDelete
(BulkOperationRequest bulkOperationRequest, SearchUser searchUser) create
(@Valid @NotNull(message="View is mandatory") ViewDTO dto, UserContext userContext, SearchUser searchUser) delete
(@NotEmpty String id, SearchUser searchUser) get
(@NotEmpty String id, SearchUser searchUser) void
setDefault
(@NotEmpty String id) update
(@NotEmpty String id, @Valid ViewDTO dto, SearchUser searchUser) protected void
validateSearchProperties
(ViewDTO dto, Search search) views
(int page, int perPage, String sortField, String order, String query, SearchUser searchUser) Methods inherited from class org.graylog2.shared.rest.resources.RestResource
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrint
-
Constructor Details
-
ViewsResource
@Inject public ViewsResource(ViewService dbService, StartPageService startPageService, RecentActivityService recentActivityService, ClusterEventBus clusterEventBus, SearchDomain searchDomain, Map<String, ViewResolver> viewResolvers, SearchFilterVisibilityChecker searchFilterVisibilityChecker, ReferencedSearchFiltersHelper referencedSearchFiltersHelper, AuditEventSender auditEventSender, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
views
@GET public PaginatedResponse<ViewDTO> views(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @DefaultValue("title") @QueryParam("sort") String sortField, @DefaultValue("asc") @QueryParam("order") String order, @QueryParam("query") String query, @Context SearchUser searchUser) -
get
@GET @Path("{id}") public ViewDTO get(@PathParam("id") @NotEmpty @NotEmpty String id, @Context SearchUser searchUser) -
create
@POST public ViewDTO create(@Valid @NotNull(message="View is mandatory") @Valid @NotNull(message="View is mandatory") ViewDTO dto, @Context UserContext userContext, @Context SearchUser searchUser) throws ValidationException - Throws:
ValidationException
-
validateSearchProperties
-
update
@PUT @Path("{id}") public ViewDTO update(@PathParam("id") @NotEmpty @NotEmpty String id, @Valid @Valid ViewDTO dto, @Context SearchUser searchUser) -
setDefault
-
delete
@DELETE @Path("{id}") public ViewDTO delete(@PathParam("id") @NotEmpty @NotEmpty String id, @Context SearchUser searchUser) -
bulkDelete
@POST @Path("/bulk_delete") @Consumes("application/json") @Timed public javax.ws.rs.core.Response bulkDelete(BulkOperationRequest bulkOperationRequest, @Context SearchUser searchUser)
-