use of org.apache.cloudstack.api.response.DiskOfferingResponse in project cloudstack by apache.
the class UpdateDiskOfferingCmd method execute.
@Override
public void execute() {
DiskOffering result = _configService.updateDiskOffering(this);
if (result != null) {
DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update disk offering");
}
}
use of org.apache.cloudstack.api.response.DiskOfferingResponse in project cloudstack by apache.
the class CreateDiskOfferingCmd method execute.
@Override
public void execute() {
DiskOffering offering = _configService.createDiskOffering(this);
if (offering != null) {
DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(offering);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create disk offering");
}
}
use of org.apache.cloudstack.api.response.DiskOfferingResponse in project cloudstack by apache.
the class DiskOfferingJoinDaoImpl method newDiskOfferingResponse.
@Override
public DiskOfferingResponse newDiskOfferingResponse(DiskOfferingJoinVO offering) {
DiskOfferingResponse diskOfferingResponse = new DiskOfferingResponse();
diskOfferingResponse.setId(offering.getUuid());
diskOfferingResponse.setName(offering.getName());
diskOfferingResponse.setDisplayText(offering.getDisplayText());
diskOfferingResponse.setProvisioningType(offering.getProvisioningType().toString());
diskOfferingResponse.setCreated(offering.getCreated());
diskOfferingResponse.setDiskSize(offering.getDiskSize() / (1024 * 1024 * 1024));
diskOfferingResponse.setMinIops(offering.getMinIops());
diskOfferingResponse.setMaxIops(offering.getMaxIops());
diskOfferingResponse.setDomain(offering.getDomainName());
diskOfferingResponse.setDomainId(offering.getDomainUuid());
diskOfferingResponse.setDisplayOffering(offering.isDisplayOffering());
diskOfferingResponse.setTags(offering.getTags());
diskOfferingResponse.setCustomized(offering.isCustomized());
diskOfferingResponse.setCustomizedIops(offering.isCustomizedIops());
diskOfferingResponse.setHypervisorSnapshotReserve(offering.getHypervisorSnapshotReserve());
diskOfferingResponse.setStorageType(offering.isUseLocalStorage() ? ServiceOffering.StorageType.local.toString() : ServiceOffering.StorageType.shared.toString());
diskOfferingResponse.setBytesReadRate(offering.getBytesReadRate());
diskOfferingResponse.setBytesWriteRate(offering.getBytesWriteRate());
diskOfferingResponse.setIopsReadRate(offering.getIopsReadRate());
diskOfferingResponse.setIopsWriteRate(offering.getIopsWriteRate());
diskOfferingResponse.setCacheMode(offering.getCacheMode());
diskOfferingResponse.setObjectName("diskoffering");
return diskOfferingResponse;
}
Aggregations