use of org.apache.cloudstack.api.ServerApiException in project cloudstack by apache.
the class UploadCustomCertificateCmd method execute.
@Override
public void execute() {
String result = _mgr.uploadCertificate(this);
if (result != null) {
CustomCertificateResponse response = new CustomCertificateResponse();
response.setResponseName(getCommandName());
response.setResultMessage(result);
response.setObjectName("customcertificate");
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to upload custom certificate");
}
}
use of org.apache.cloudstack.api.ServerApiException in project cloudstack by apache.
the class ConfigureOvsElementCmd method execute.
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Ovs element: " + id);
OvsProvider result = _service.get(0).configure(this);
if (result != null) {
OvsProviderResponse ovsResponse = _responseGenerator.createOvsProviderResponse(result);
ovsResponse.setResponseName(getCommandName());
this.setResponseObject(ovsResponse);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure the ovs provider");
}
}
use of org.apache.cloudstack.api.ServerApiException in project cloudstack by apache.
the class CreateServiceOfferingCmd method execute.
@Override
public void execute() {
ServiceOffering result = _configService.createServiceOffering(this);
if (result != null) {
ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create service offering");
}
}
use of org.apache.cloudstack.api.ServerApiException in project cloudstack by apache.
the class DeleteDiskOfferingCmd method execute.
@Override
public void execute() {
boolean result = _configService.deleteDiskOffering(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete disk offering");
}
}
use of org.apache.cloudstack.api.ServerApiException in project cloudstack by apache.
the class DeleteServiceOfferingCmd method execute.
@Override
public void execute() {
boolean result = _configService.deleteServiceOffering(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete service offering");
}
}
Aggregations