return resourceCountResponse;
}
@Override
public ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering) {
ServiceOfferingResponse offeringResponse = new ServiceOfferingResponse();
offeringResponse.setId(offering.getId());
offeringResponse.setName(offering.getName());
offeringResponse.setIsSystemOffering(offering.getSystemUse());
offeringResponse.setDefaultUse(offering.getDefaultUse());
offeringResponse.setSystemVmType(offering.getSystemVmType());
offeringResponse.setDisplayText(offering.getDisplayText());
offeringResponse.setCpuNumber(offering.getCpu());
offeringResponse.setCpuSpeed(offering.getSpeed());
offeringResponse.setMemory(offering.getRamSize());
offeringResponse.setCreated(offering.getCreated());
offeringResponse.setStorageType(offering.getUseLocalStorage() ? ServiceOffering.StorageType.local.toString() : ServiceOffering.StorageType.shared.toString());
offeringResponse.setOfferHa(offering.getOfferHA());
offeringResponse.setLimitCpuUse(offering.getLimitCpuUse());
offeringResponse.setTags(offering.getTags());
if (offering.getDomainId() != null) {
offeringResponse.setDomain(ApiDBUtils.findDomainById(offering.getDomainId()).getName());
offeringResponse.setDomainId(offering.getDomainId());
}
offeringResponse.setNetworkRate(offering.getRateMbps());
offeringResponse.setHostTag(offering.getHostTag());
offeringResponse.setObjectName("serviceoffering");
return offeringResponse;
}