mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Update service offering id in the NetworkServiceOfferingResponse
This commit is contained in:
parent
2c2dfdc507
commit
2902f3d8bd
@ -81,6 +81,7 @@ import com.cloud.resource.ResourceManager;
|
||||
import com.cloud.server.Criteria;
|
||||
import com.cloud.server.ManagementServer;
|
||||
import com.cloud.server.StatsCollector;
|
||||
import com.cloud.service.ServiceOfferingVO;
|
||||
import com.cloud.service.dao.ServiceOfferingDao;
|
||||
import com.cloud.storage.DiskOfferingVO;
|
||||
import com.cloud.storage.GuestOS;
|
||||
@ -723,4 +724,9 @@ public class ApiDBUtils {
|
||||
public static long countFreePublicIps() {
|
||||
return _ipAddressDao.countFreeIPs();
|
||||
}
|
||||
|
||||
public static long findDefaultRouterServiceOffering() {
|
||||
ServiceOfferingVO serviceOffering = _serviceOfferingDao.findByName("Cloud.Com-SoftwareRouter");
|
||||
return serviceOffering.getId();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2572,8 +2572,12 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
response.setIsDefault(offering.isDefault());
|
||||
response.setSpecifyVlan(offering.getSpecifyVlan());
|
||||
response.setAvailability(offering.getAvailability().toString());
|
||||
response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId()));
|
||||
response.setServiceOfferingId(offering.getServiceOfferingId());
|
||||
response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId()));
|
||||
if (offering.getServiceOfferingId() != null) {
|
||||
response.setServiceOfferingId(offering.getServiceOfferingId());
|
||||
} else {
|
||||
response.setServiceOfferingId(ApiDBUtils.findDefaultRouterServiceOffering());
|
||||
}
|
||||
if (offering.getGuestType() != null) {
|
||||
response.setGuestIpType(offering.getGuestType().toString());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user