mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 7553: cloudStack - server-side - make listRouters API return “serviceofferingname” and “serviceofferingid”.
This commit is contained in:
parent
0685782fa9
commit
8c4e831cfb
@ -113,6 +113,12 @@ public class DomainRouterResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain associated with the router")
|
||||
private String domainName;
|
||||
|
||||
@SerializedName("serviceofferingid") @Param(description="the ID of the service offering of the virtual machine")
|
||||
private Long serviceOfferingId;
|
||||
|
||||
@SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine")
|
||||
private String serviceOfferingName;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -353,4 +359,19 @@ public class DomainRouterResponse extends BaseResponse {
|
||||
this.linkLocalNetworkId = linkLocalNetworkId;
|
||||
}
|
||||
|
||||
public Long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
|
||||
public void setServiceOfferingId(Long serviceOfferingId) {
|
||||
this.serviceOfferingId = serviceOfferingId;
|
||||
}
|
||||
|
||||
public String getServiceOfferingName() {
|
||||
return serviceOfferingName;
|
||||
}
|
||||
|
||||
public void setServiceOfferingName(String serviceOfferingName) {
|
||||
this.serviceOfferingName = serviceOfferingName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,6 +123,10 @@ public class DomainRouterVO extends VMInstanceVO implements VirtualRouter {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
public void setServiceOfferingId(long serviceOfferingId) {
|
||||
this.serviceOfferingId = serviceOfferingId;
|
||||
}
|
||||
|
||||
@ -1223,6 +1223,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
|
||||
@Override
|
||||
public DomainRouterResponse createDomainRouterResponse(VirtualRouter router) {
|
||||
Map<Long, ServiceOffering> serviceOfferings = new HashMap<Long, ServiceOffering>();
|
||||
|
||||
DomainRouterResponse routerResponse = new DomainRouterResponse();
|
||||
routerResponse.setId(router.getId());
|
||||
routerResponse.setZoneId(router.getDataCenterId());
|
||||
@ -1236,7 +1238,17 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
routerResponse.setHostId(router.getHostId());
|
||||
routerResponse.setHostName(ApiDBUtils.findHostById(router.getHostId()).getName());
|
||||
}
|
||||
|
||||
// Service Offering Info
|
||||
ServiceOffering offering = serviceOfferings.get(router.getServiceOfferingId());
|
||||
|
||||
if (offering == null) {
|
||||
offering = ApiDBUtils.findServiceOfferingById(router.getServiceOfferingId());
|
||||
serviceOfferings.put(offering.getId(), offering);
|
||||
}
|
||||
routerResponse.setServiceOfferingId(offering.getId());
|
||||
routerResponse.setServiceOfferingName(offering.getName());
|
||||
|
||||
Account accountTemp = ApiDBUtils.findAccountById(router.getAccountId());
|
||||
if (accountTemp != null) {
|
||||
routerResponse.setAccountName(accountTemp.getAccountName());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user