Search in sources :

Example 11 with AlertManagerUnreachableException

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

Example 12 with AlertManagerUnreachableException

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

Example 13 with AlertManagerUnreachableException

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

Example 14 with AlertManagerUnreachableException

use of io.hops.hopsworks.alert.exception.AlertManagerUnreachableException 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 15 with AlertManagerUnreachableException

use of io.hops.hopsworks.alert.exception.AlertManagerUnreachableException 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)

Aggregations

AlertManagerUnreachableException (io.hops.hopsworks.alert.exception.AlertManagerUnreachableException)34 AlertManagerClientCreateException (io.hops.hopsworks.alerting.exceptions.AlertManagerClientCreateException)21 AlertException (io.hops.hopsworks.exceptions.AlertException)20 JWTRequired (io.hops.hopsworks.jwt.annotation.JWTRequired)16 Produces (javax.ws.rs.Produces)16 AlertManagerConfigCtrlCreateException (io.hops.hopsworks.alerting.exceptions.AlertManagerConfigCtrlCreateException)14 AlertManagerConfigReadException (io.hops.hopsworks.alerting.exceptions.AlertManagerConfigReadException)14 AlertManagerConfigUpdateException (io.hops.hopsworks.alerting.exceptions.AlertManagerConfigUpdateException)14 AlertManagerServerException (io.hops.hopsworks.alerting.exceptions.AlertManagerServerException)13 Consumes (javax.ws.rs.Consumes)13 Path (javax.ws.rs.Path)12 ResourceRequest (io.hops.hopsworks.common.api.ResourceRequest)11 ApiOperation (io.swagger.annotations.ApiOperation)11 AlertManagerAccessControlException (io.hops.hopsworks.alert.exception.AlertManagerAccessControlException)10 AlertManagerDuplicateEntryException (io.hops.hopsworks.alerting.exceptions.AlertManagerDuplicateEntryException)8 POST (javax.ws.rs.POST)8 PUT (javax.ws.rs.PUT)8 AlertManagerNoSuchElementException (io.hops.hopsworks.alerting.exceptions.AlertManagerNoSuchElementException)7 AlertManagerResponseException (io.hops.hopsworks.alerting.exceptions.AlertManagerResponseException)7 AllowedProjectRoles (io.hops.hopsworks.api.filter.AllowedProjectRoles)7