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");
}
}
Aggregations