use of org.graylog2.rest.models.alarmcallbacks.AlarmCallbackSummary in project graylog2-server by Graylog2.
the class StreamAlarmCallbackResource method get.
@GET
@Timed
@ApiOperation(value = "Get a list of all alarm callbacks for this stream")
@Produces(MediaType.APPLICATION_JSON)
public AlarmCallbackListSummary get(@ApiParam(name = "streamid", value = "The id of the stream whose alarm callbacks we want.", required = true) @PathParam("streamid") String streamid) throws NotFoundException {
checkPermission(RestPermissions.STREAMS_READ, streamid);
final Stream stream = streamService.load(streamid);
final List<AlarmCallbackSummary> alarmCallbacks = Lists.newArrayList();
for (AlarmCallbackConfiguration callback : alarmCallbackConfigurationService.getForStream(stream)) {
alarmCallbacks.add(AlarmCallbackSummary.create(callback.getId(), callback.getStreamId(), callback.getType(), callback.getTitle(), callback.getConfiguration(), callback.getCreatedAt(), callback.getCreatorUserId()));
}
return AlarmCallbackListSummary.create(alarmCallbacks);
}
Aggregations