Search in sources :

Example 1 with AlertmanagerStatus

use of io.hops.hopsworks.alerting.api.alert.dto.AlertmanagerStatus in project hopsworks by logicalclocks.

the class AlertManager method getStatus.

public AlertmanagerStatus getStatus() throws AlertManagerResponseException, AlertManagerClientCreateException, AlertManagerUnreachableException {
    doClientSanityCheck();
    try {
        AlertmanagerStatus response = client.getStatus();
        registerSuccess();
        return response;
    } catch (AlertManagerServerException e) {
        registerServerError();
        throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
    }
}
Also used : AlertManagerUnreachableException(io.hops.hopsworks.alert.exception.AlertManagerUnreachableException) AlertManagerServerException(io.hops.hopsworks.alerting.exceptions.AlertManagerServerException) AlertmanagerStatus(io.hops.hopsworks.alerting.api.alert.dto.AlertmanagerStatus)

Example 2 with AlertmanagerStatus

use of io.hops.hopsworks.alerting.api.alert.dto.AlertmanagerStatus in project hopsworks by logicalclocks.

the class AlertManagerClient method getStatus.

public AlertmanagerStatus getStatus() throws AlertManagerResponseException, AlertManagerServerException {
    WebTarget wt = webTarget.path(Settings.ALERTS_API_STATUS);
    LOGGER.log(Level.FINE, "Sending request getStatus to: {0}", wt.toString());
    AlertmanagerStatus alertmanagerStatus = getResponse(sendRequest(wt.request(MediaType.APPLICATION_JSON), RequestMethod.GET, null), AlertmanagerStatus.class);
    return alertmanagerStatus;
}
Also used : WebTarget(javax.ws.rs.client.WebTarget) AlertmanagerStatus(io.hops.hopsworks.alerting.api.alert.dto.AlertmanagerStatus)

Aggregations

AlertmanagerStatus (io.hops.hopsworks.alerting.api.alert.dto.AlertmanagerStatus)2 AlertManagerUnreachableException (io.hops.hopsworks.alert.exception.AlertManagerUnreachableException)1 AlertManagerServerException (io.hops.hopsworks.alerting.exceptions.AlertManagerServerException)1 WebTarget (javax.ws.rs.client.WebTarget)1