use of org.apache.cloudstack.alert.AlertService.AlertType in project cloudstack by apache.
the class GenerateAlertCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
AlertType alertType = AlertService.AlertType.generateAlert(getType(), getName());
if (_alertSvc.generateAlert(alertType, getZoneId(), getPodId(), getDescription())) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to generate an alert");
}
}
Aggregations