Package org.graylog.events.rest
Class EventDefinitionsResource
java.lang.Object
org.graylog2.shared.rest.resources.RestResource
org.graylog.events.rest.EventDefinitionsResource
- All Implemented Interfaces:
PluginRestResource
@Path("/events/definitions")
@Produces("application/json")
@Consumes("application/json")
public class EventDefinitionsResource
extends RestResource
implements PluginRestResource
-
Field Summary
Fields inherited from class org.graylog2.shared.rest.resources.RestResource
configuration, userService
-
Constructor Summary
ConstructorDescriptionEventDefinitionsResource
(DBEventDefinitionService dbService, EventDefinitionHandler eventDefinitionHandler, EventDefinitionContextService contextService, EventProcessorEngine engine) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearNotificationQueue
(@NotBlank String definitionId) javax.ws.rs.core.Response
create
(boolean schedule, EventDefinitionDto dto, UserContext userContext) void
void
execute
(@NotBlank String definitionId, @NotNull EventProcessorParameters parameters) getWithContext
(@NotBlank String definitionId) void
void
unschedule
(@NotBlank String definitionId) javax.ws.rs.core.Response
update
(@NotBlank String definitionId, boolean schedule, EventDefinitionDto dto) validate
(@Valid @NotNull EventDefinitionDto toValidate) Methods inherited from class org.graylog2.shared.rest.resources.RestResource
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrint
-
Constructor Details
-
EventDefinitionsResource
@Inject public EventDefinitionsResource(DBEventDefinitionService dbService, EventDefinitionHandler eventDefinitionHandler, EventDefinitionContextService contextService, EventProcessorEngine engine)
-
-
Method Details
-
list
@GET public PaginatedResponse<EventDefinitionDto> list(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @QueryParam("query") @DefaultValue("") String query) -
get
@GET @Path("{definitionId}") public EventDefinitionDto get(@PathParam("definitionId") @NotBlank @NotBlank String definitionId) -
getWithContext
-
create
@POST @Produces("application/json") public javax.ws.rs.core.Response create(@QueryParam("schedule") @DefaultValue("true") boolean schedule, EventDefinitionDto dto, @Context UserContext userContext) -
update
@PUT @Path("{definitionId}") public javax.ws.rs.core.Response update(@PathParam("definitionId") @NotBlank @NotBlank String definitionId, @QueryParam("schedule") @DefaultValue("true") boolean schedule, EventDefinitionDto dto) -
delete
@DELETE @Path("{definitionId}") public void delete(@PathParam("definitionId") @NotBlank @NotBlank String definitionId) -
schedule
@PUT @Path("{definitionId}/schedule") @Consumes("*/*") public void schedule(@PathParam("definitionId") @NotBlank @NotBlank String definitionId) -
unschedule
@PUT @Path("{definitionId}/unschedule") @Consumes("*/*") public void unschedule(@PathParam("definitionId") @NotBlank @NotBlank String definitionId) -
clearNotificationQueue
@PUT @Path("{definitionId}/clear-notification-queue") @Consumes("*/*") public void clearNotificationQueue(@PathParam("definitionId") @NotBlank @NotBlank String definitionId) -
execute
@POST @Path("{definitionId}/execute") public void execute(@PathParam("definitionId") @NotBlank @NotBlank String definitionId, @NotNull @NotNull EventProcessorParameters parameters) -
validate
@POST @Path("/validate") public ValidationResult validate(@Valid @NotNull @Valid @NotNull EventDefinitionDto toValidate)
-