}
@Override
public DiskOfferingResponse newDiskOfferingResponse(DiskOfferingJoinVO offering) {
DiskOfferingResponse diskOfferingResponse = new DiskOfferingResponse();
diskOfferingResponse.setId(offering.getUuid());
diskOfferingResponse.setName(offering.getName());
diskOfferingResponse.setDisplayText(offering.getDisplayText());
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;
}