use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.
the class AlertManagerClient method sendRequest.
private Response sendRequest(Invocation.Builder invocationBuilder, RequestMethod method, Entity<String> entity) throws AlertManagerServerException, AlertManagerResponseException {
Response response = null;
try {
switch(method) {
case GET:
response = invocationBuilder.get();
break;
case POST:
response = invocationBuilder.post(entity);
break;
case DELETE:
response = invocationBuilder.delete();
break;
}
} catch (Exception e) {
throw new AlertManagerServerException(e.getMessage());
}
checkResponse(response);
return response;
}
use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.
the class AlertManager method healthy.
public Response healthy() throws AlertManagerClientCreateException, AlertManagerResponseException, AlertManagerUnreachableException {
doClientSanityCheck();
try {
Response response = client.healthy();
registerSuccess();
return response;
} catch (AlertManagerServerException e) {
registerServerError();
throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
}
}
use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.
the class AlertManager method getAlerts.
public List<Alert> getAlerts() throws AlertManagerResponseException, AlertManagerClientCreateException, AlertManagerUnreachableException {
doClientSanityCheck();
try {
List<Alert> response = client.getAlerts();
registerSuccess();
return response;
} catch (AlertManagerServerException e) {
registerServerError();
throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
}
}
use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.
the class AlertManager method postSilences.
/**
* Post a new silence or update an existing one
* @param postableSilence
* @return
* @throws AlertManagerResponseException
* @throws AlertManagerClientCreateException
* @throws AlertManagerUnreachableException
*/
public SilenceID postSilences(PostableSilence postableSilence) throws AlertManagerResponseException, AlertManagerClientCreateException, AlertManagerUnreachableException {
doClientSanityCheck();
try {
SilenceID response = client.postSilences(postableSilence);
registerSuccess();
return response;
} catch (AlertManagerServerException e) {
registerServerError();
throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
}
}
use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.
the class AlertManager method getAlertGroups.
public List<AlertGroup> getAlertGroups(Boolean active, Boolean silenced, Boolean inhibited, Set<String> filters, String receiver) throws AlertManagerResponseException, AlertManagerClientCreateException, AlertManagerUnreachableException {
doClientSanityCheck();
try {
List<AlertGroup> response = client.getAlertGroups(active, silenced, inhibited, filters, receiver);
registerSuccess();
return response;
} catch (AlertManagerServerException e) {
registerServerError();
throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
}
}
Aggregations