use of com.thinkbiganalytics.alerts.rest.model.AlertRange in project kylo by Teradata.
the class SlaIT method assertSuccessfulSlaAppearsNotInAlerts.
private void assertSuccessfulSlaAppearsNotInAlerts(String slaId) {
AlertRange range = getAlerts();
List<Alert> alerts = range.getAlerts();
Assert.assertFalse(anyAlertMatch(slaId, alerts));
}
use of com.thinkbiganalytics.alerts.rest.model.AlertRange in project kylo by Teradata.
the class SlaIT method assertFailedSlaAppearsInAlerts.
private void assertFailedSlaAppearsInAlerts(String slaId) {
AlertRange range = getAlerts();
List<Alert> alerts = range.getAlerts();
Assert.assertTrue(anyAlertMatch(slaId, alerts));
}
use of com.thinkbiganalytics.alerts.rest.model.AlertRange in project kylo by Teradata.
the class AlertsController method getAlerts.
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Lists the current alerts.")
@ApiResponses(@ApiResponse(code = 200, message = "Returns the alerts.", response = AlertRange.class))
public AlertRange getAlerts(@QueryParam("limit") Integer limit, @QueryParam("type") String type, @QueryParam("subtype") String subtype, @QueryParam("state") String state, @QueryParam("level") String level, @QueryParam("before") String before, @QueryParam("after") String after, @QueryParam("cleared") @DefaultValue("false") String cleared, @QueryParam("filter") String filter) {
List<Alert> alerts = new ArrayList<>();
AlertCriteria criteria = createCriteria(limit, type, subtype, state, level, before, after, cleared);
criteria.orFilter(filter);
provider.getAlerts(criteria).forEachRemaining(alerts::add);
return new AlertRange(alerts.stream().map(alertsModel::toModel).collect(Collectors.toList()));
}
Aggregations