Search in sources :

Example 6 with AlertManagerServerException

use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.

the class AlertManager method reload.

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

Example 7 with AlertManagerServerException

use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException 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);
    }
}
Also used : AlertManagerUnreachableException(io.hops.hopsworks.alert.exception.AlertManagerUnreachableException) AlertManagerServerException(io.hops.hopsworks.alerting.exceptions.AlertManagerServerException) ReceiverName(io.hops.hopsworks.alerting.api.alert.dto.ReceiverName)

Example 8 with AlertManagerServerException

use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.

the class AlertManager method ready.

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

Example 9 with AlertManagerServerException

use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.

the class AlertManager method deleteSilence.

public Response deleteSilence(String uuid) throws AlertManagerClientCreateException, AlertManagerResponseException, AlertManagerUnreachableException {
    doClientSanityCheck();
    try {
        Response response = client.deleteSilence(uuid);
        registerSuccess();
        return response;
    } catch (AlertManagerServerException e) {
        registerServerError();
        throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
    }
}
Also used : Response(javax.ws.rs.core.Response) AlertManagerUnreachableException(io.hops.hopsworks.alert.exception.AlertManagerUnreachableException) AlertManagerServerException(io.hops.hopsworks.alerting.exceptions.AlertManagerServerException)

Example 10 with AlertManagerServerException

use of io.hops.hopsworks.alerting.exceptions.AlertManagerServerException in project hopsworks by logicalclocks.

the class AlertManager method postAlerts.

public Response postAlerts(List<PostableAlert> postableAlerts) throws AlertManagerClientCreateException, AlertManagerResponseException, AlertManagerUnreachableException {
    doClientSanityCheck();
    try {
        Response response = client.postAlerts(postableAlerts);
        registerSuccess();
        return response;
    } catch (AlertManagerServerException e) {
        registerServerError();
        throw new AlertManagerUnreachableException("Alertmanager not reachable." + e.getMessage(), e);
    }
}
Also used : Response(javax.ws.rs.core.Response) AlertManagerUnreachableException(io.hops.hopsworks.alert.exception.AlertManagerUnreachableException) AlertManagerServerException(io.hops.hopsworks.alerting.exceptions.AlertManagerServerException)

Aggregations

AlertManagerServerException (io.hops.hopsworks.alerting.exceptions.AlertManagerServerException)17 AlertManagerUnreachableException (io.hops.hopsworks.alert.exception.AlertManagerUnreachableException)13 Response (javax.ws.rs.core.Response)6 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 AlertManagerConfigUpdateException (io.hops.hopsworks.alerting.exceptions.AlertManagerConfigUpdateException)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 Alert (io.hops.hopsworks.alerting.api.alert.dto.Alert)2 PostableAlert (io.hops.hopsworks.alerting.api.alert.dto.PostableAlert)2 PostableSilence (io.hops.hopsworks.alerting.api.alert.dto.PostableSilence)2 Silence (io.hops.hopsworks.alerting.api.alert.dto.Silence)2 AlertManagerResponseException (io.hops.hopsworks.alerting.exceptions.AlertManagerResponseException)2 JSONObject (org.json.JSONObject)2 ServiceDiscoveryException (com.logicalclocks.servicediscoverclient.exceptions.ServiceDiscoveryException)1 AlertGroup (io.hops.hopsworks.alerting.api.alert.dto.AlertGroup)1 AlertmanagerStatus (io.hops.hopsworks.alerting.api.alert.dto.AlertmanagerStatus)1 ReceiverName (io.hops.hopsworks.alerting.api.alert.dto.ReceiverName)1 SilenceID (io.hops.hopsworks.alerting.api.alert.dto.SilenceID)1 AlertManagerConfig (io.hops.hopsworks.alerting.config.dto.AlertManagerConfig)1 IOException (java.io.IOException)1