use of io.hops.hopsworks.alerting.api.alert.dto.ReceiverName in project hopsworks by logicalclocks.
the class AlertManagerClient method getReceivers.
public List<ReceiverName> getReceivers() throws AlertManagerResponseException, AlertManagerServerException {
WebTarget wt = webTarget.path(Settings.ALERTS_API_RECEIVERS);
LOGGER.log(Level.FINE, "Sending request getReceivers to: {0}", wt.toString());
List<ReceiverName> receiver = getResponseList(sendRequest(wt.request(MediaType.APPLICATION_JSON), RequestMethod.GET, null), ReceiverName.class);
return receiver;
}
use of io.hops.hopsworks.alerting.api.alert.dto.ReceiverName in project hopsworks by logicalclocks.
the class AlertManager method getReceivers.
public List<ReceiverName> getReceivers() throws AlertManagerResponseException, AlertManagerClientCreateException, AlertManagerUnreachableException {
doClientSanityCheck();
try {
List<ReceiverName> response = client.getReceivers();
registerSuccess();
return response;
} catch (AlertManagerServerException e) {
registerServerError();
throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
}
}
use of io.hops.hopsworks.alerting.api.alert.dto.ReceiverName in project hopsworks by logicalclocks.
the class ReceiverBuilder method itemsExpand.
private ReceiverDTO itemsExpand(ReceiverDTO dto, UriInfo uriInfo, ResourceRequest resourceRequest, ReceiverBeanParam receiverBeanParam, Project project, Boolean includeGlobal) throws AlertException {
uri(dto, uriInfo);
expand(dto, resourceRequest);
if (dto.isExpand()) {
List<ReceiverName> receiverNameList = getReceiverNames(project, includeGlobal);
List<Receiver> receivers = new ArrayList<>();
for (ReceiverName receiverName : receiverNameList) {
receivers.add(getReceiver(receiverName.getName(), project));
}
dto.setCount((long) receivers.size());
return itemsExpand(dto, uriInfo, resourceRequest, receiverBeanParam, receivers);
}
return dto;
}
Aggregations