Search in sources :

Example 1 with AlertType

use of com.cloud.alert.AlertService.AlertType in project cosmic by MissionCriticalCloud.

the class GenerateAlertCmd method execute.

@Override
public void execute() {
    final AlertType alertType = AlertService.AlertType.generateAlert(getType(), getName());
    if (_alertSvc.generateAlert(alertType, getZoneId(), getPodId(), getDescription())) {
        final SuccessResponse response = new SuccessResponse(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to generate an alert");
    }
}
Also used : AlertType(com.cloud.alert.AlertService.AlertType) SuccessResponse(com.cloud.api.response.SuccessResponse) ServerApiException(com.cloud.api.ServerApiException)

Aggregations

AlertType (com.cloud.alert.AlertService.AlertType)1 ServerApiException (com.cloud.api.ServerApiException)1 SuccessResponse (com.cloud.api.response.SuccessResponse)1