Package org.graylog.events.rest
Class EventNotificationsResource
java.lang.Object
org.graylog2.shared.rest.resources.RestResource
org.graylog.events.rest.EventNotificationsResource
- All Implemented Interfaces:
PluginRestResource
@Path("/events/notifications")
@Produces("application/json")
@Consumes("application/json")
@RequiresAuthentication
public class EventNotificationsResource
extends RestResource
implements PluginRestResource
-
Field Summary
Fields inherited from class org.graylog2.shared.rest.resources.RestResource
configuration, userService
-
Constructor Summary
ConstructorDescriptionEventNotificationsResource
(DBNotificationService dbNotificationService, Set<AlarmCallback> availableLegacyAlarmCallbacks, NotificationResourceHandler resourceHandler, EmailConfiguration emailConfiguration, RecentActivityService recentActivityService) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
create
(NotificationDto dto, UserContext userContext) void
delete
(@NotBlank String notificationId, UserContext userContext) javax.ws.rs.core.Response
listNotifications
(int page, int perPage, String query) Deprecated.javax.ws.rs.core.Response
javax.ws.rs.core.Response
test
(NotificationDto dto) javax.ws.rs.core.Response
update
(@NotBlank String notificationId, NotificationDto dto, UserContext userContext) Methods inherited from class org.graylog2.shared.rest.resources.RestResource
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrint
-
Constructor Details
-
EventNotificationsResource
@Inject public EventNotificationsResource(DBNotificationService dbNotificationService, Set<AlarmCallback> availableLegacyAlarmCallbacks, NotificationResourceHandler resourceHandler, EmailConfiguration emailConfiguration, RecentActivityService recentActivityService)
-
-
Method Details
-
getPage
@GET @Timed @Path("/paginated") @Produces("application/json") public PageListResponse<NotificationDto> getPage(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @QueryParam("query") @DefaultValue("") String query, @DefaultValue("title") @QueryParam("sort") String sort, @DefaultValue("asc") @QueryParam("order") String order) -
listNotifications
@GET @Deprecated public PaginatedResponse<NotificationDto> listNotifications(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @QueryParam("query") @DefaultValue("") String query) Deprecated. -
get
@GET @Path("/{notificationId}") public NotificationDto get(@PathParam("notificationId") @NotBlank @NotBlank String notificationId) -
create
@POST @RequiresPermissions("eventnotifications:create") public javax.ws.rs.core.Response create(NotificationDto dto, @Context UserContext userContext) -
update
@PUT @Path("/{notificationId}") public javax.ws.rs.core.Response update(@PathParam("notificationId") @NotBlank @NotBlank String notificationId, NotificationDto dto, @Context UserContext userContext) -
delete
@DELETE @Path("/{notificationId}") public void delete(@PathParam("notificationId") @NotBlank @NotBlank String notificationId, @Context UserContext userContext) -
test
@POST @Timed @Path("/{notificationId}/test") public javax.ws.rs.core.Response test(@PathParam("notificationId") @NotBlank @NotBlank String notificationId) -
test
@POST @Timed @Path("/test") @RequiresPermissions("eventnotifications:create") public javax.ws.rs.core.Response test(NotificationDto dto) -
legacyTypes
@GET @Path("/legacy/types") public javax.ws.rs.core.Response legacyTypes()
-