use of org.graylog2.rest.models.alarmcallbacks.responses.AvailableAlarmCallbacksResponse in project graylog2-server by Graylog2.
the class AlarmCallbacksResource method available.
@GET
@Path("/types")
@Timed
@ApiOperation(value = "Get a list of all alarm callbacks types")
public AvailableAlarmCallbacksResponse available() {
final Map<String, AvailableAlarmCallbackSummaryResponse> types = Maps.newHashMapWithExpectedSize(availableAlarmCallbacks.size());
for (AlarmCallback availableAlarmCallback : availableAlarmCallbacks) {
final AvailableAlarmCallbackSummaryResponse type = new AvailableAlarmCallbackSummaryResponse();
type.name = availableAlarmCallback.getName();
type.requested_configuration = getConfigurationRequest(availableAlarmCallback).asList();
types.put(availableAlarmCallback.getClass().getCanonicalName(), type);
}
final AvailableAlarmCallbacksResponse response = new AvailableAlarmCallbacksResponse();
response.types = types;
return response;
}
Aggregations