Skip to content

Commit 3ede1ea

Browse files
committed
Merge remote-tracking branch 'origin/4.14'
2 parents cbbb401 + 26f4edf commit 3ede1ea

13 files changed

Lines changed: 137 additions & 6 deletions

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ public class ApiConstants {
353353
public static final String TARGET_IQN = "targetiqn";
354354
public static final String TEMPLATE_FILTER = "templatefilter";
355355
public static final String TEMPLATE_ID = "templateid";
356+
public static final String TEMPLATE_NAME = "templatename";
356357
public static final String ISO_ID = "isoid";
357358
public static final String TIMEOUT = "timeout";
358359
public static final String TIMEZONE = "timezone";
@@ -601,8 +602,10 @@ public class ApiConstants {
601602
public static final String END_POINT = "endpoint";
602603
public static final String REGION_ID = "regionid";
603604
public static final String VPC_OFF_ID = "vpcofferingid";
605+
public static final String VPC_OFF_NAME = "vpcofferingname";
604606
public static final String NETWORK = "network";
605607
public static final String VPC_ID = "vpcid";
608+
public static final String VPC_NAME = "vpcname";
606609
public static final String GATEWAY_ID = "gatewayid";
607610
public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
608611
public static final String RESOURCE_IDS = "resourceids";

api/src/main/java/org/apache/cloudstack/api/response/DomainRouterResponse.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
7777
@Param(description = "the Pod ID for the router")
7878
private String podId;
7979

80+
@SerializedName(ApiConstants.POD_NAME)
81+
@Param(description = "the Pod name for the router", since = "4.13.2")
82+
private String podName;
83+
8084
@SerializedName(ApiConstants.HOST_ID)
8185
@Param(description = "the host ID for the router")
8286
private String hostId;
@@ -145,6 +149,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
145149
@Param(description = "the template ID for the router")
146150
private String templateId;
147151

152+
@SerializedName(ApiConstants.TEMPLATE_NAME)
153+
@Param(description = "the template name for the router", since = "4.13.2")
154+
private String templateName;
155+
148156
@SerializedName(ApiConstants.CREATED)
149157
@Param(description = "the date and time the router was created")
150158
private Date created;
@@ -278,6 +286,10 @@ public void setPodId(String podId) {
278286
this.podId = podId;
279287
}
280288

289+
public void setPodName(String podName) {
290+
this.podName = podName;
291+
}
292+
281293
public void setHostId(String hostId) {
282294
this.hostId = hostId;
283295
}
@@ -330,6 +342,10 @@ public void setTemplateId(String templateId) {
330342
this.templateId = templateId;
331343
}
332344

345+
public void setTemplateName(String templateName) {
346+
this.templateName = templateName;
347+
}
348+
333349
public void setCreated(Date created) {
334350
this.created = created;
335351
}

api/src/main/java/org/apache/cloudstack/api/response/IPAddressResponse.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,13 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
136136
private String purpose;
137137

138138
@SerializedName(ApiConstants.VPC_ID)
139-
@Param(description = "VPC the ip belongs to")
139+
@Param(description = "VPC id the ip belongs to")
140140
private String vpcId;
141+
142+
@SerializedName(ApiConstants.VPC_NAME)
143+
@Param(description = "VPC name the ip belongs to", since = "4.13.2")
144+
private String vpcName;
145+
141146
@SerializedName(ApiConstants.TAGS)
142147
@Param(description = "the list of resource tags associated with ip address", responseObject = ResourceTagResponse.class)
143148
private List<ResourceTagResponse> tags;
@@ -277,6 +282,10 @@ public void setVpcId(String vpcId) {
277282
this.vpcId = vpcId;
278283
}
279284

285+
public void setVpcName(String vpcName) {
286+
this.vpcName = vpcName;
287+
}
288+
280289
public void setTags(List<ResourceTagResponse> tags) {
281290
this.tags = tags;
282291
}

api/src/main/java/org/apache/cloudstack/api/response/PrivateGatewayResponse.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn
5858
private String broadcastUri;
5959

6060
@SerializedName(ApiConstants.VPC_ID)
61-
@Param(description = "VPC the private gateaway belongs to")
61+
@Param(description = "VPC id the private gateway belongs to")
6262
private String vpcId;
6363

64+
@SerializedName(ApiConstants.VPC_NAME)
65+
@Param(description = "VPC name the private gateway belongs to", since = "4.13.2")
66+
private String vpcName;
67+
6468
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID)
6569
@Param(description = "the physical network id")
6670
private String physicalNetworkId;
@@ -130,6 +134,10 @@ public void setVpcId(String vpcId) {
130134
this.vpcId = vpcId;
131135
}
132136

137+
public void setVpcName(String vpcName) {
138+
this.vpcName = vpcName;
139+
}
140+
133141
public void setAddress(String address) {
134142
this.address = address;
135143
}

api/src/main/java/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements Control
4242
@Param(description = "the vpc id of this gateway")
4343
private String vpcId;
4444

45+
@SerializedName(ApiConstants.VPC_NAME)
46+
@Param(description = "the vpc name of this gateway", since = "4.13.2")
47+
private String vpcName;
48+
4549
@SerializedName(ApiConstants.ACCOUNT)
4650
@Param(description = "the owner")
4751
private String accountName;
@@ -82,6 +86,10 @@ public void setVpcId(String vpcId) {
8286
this.vpcId = vpcId;
8387
}
8488

89+
public void setVpcName(String vpcName) {
90+
this.vpcName = vpcName;
91+
}
92+
8593
public void setRemoved(Date removed) {
8694
this.removed = removed;
8795
}

api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public class SystemVmResponse extends BaseResponse {
7878
@Param(description = "the Pod ID for the system VM")
7979
private String podId;
8080

81+
@SerializedName("podname")
82+
@Param(description = "the Pod name for the system VM", since = "4.13.2")
83+
private String podName;
84+
8185
@SerializedName("hostid")
8286
@Param(description = "the host ID for the system VM")
8387
private String hostId;
@@ -130,6 +134,10 @@ public class SystemVmResponse extends BaseResponse {
130134
@Param(description = "the template ID for the system VM")
131135
private String templateId;
132136

137+
@SerializedName("templatename")
138+
@Param(description = "the template name for the system VM", since = "4.13.2")
139+
private String templateName;
140+
133141
@SerializedName("created")
134142
@Param(description = "the date and time the system VM was created")
135143
private Date created;
@@ -243,10 +251,18 @@ public String getPodId() {
243251
return podId;
244252
}
245253

254+
public String getPodName() {
255+
return podName;
256+
}
257+
246258
public void setPodId(String podId) {
247259
this.podId = podId;
248260
}
249261

262+
public void setPodName(String podName) {
263+
this.podName = podName;
264+
}
265+
250266
public String getHostId() {
251267
return hostId;
252268
}
@@ -323,10 +339,18 @@ public String getTemplateId() {
323339
return templateId;
324340
}
325341

342+
public String getTemplateName() {
343+
return templateName;
344+
}
345+
326346
public void setTemplateId(String templateId) {
327347
this.templateId = templateId;
328348
}
329349

350+
public void setTemplateName(String templateName) {
351+
this.templateName = templateName;
352+
}
353+
330354
public Date getCreated() {
331355
return created;
332356
}

api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
298298
@Param(description = "OS type id of the vm", since = "4.4")
299299
private String osTypeId;
300300

301+
@SerializedName(ApiConstants.OS_DISPLAY_NAME)
302+
@Param(description = "OS name of the vm", since = "4.13.2")
303+
private String osDisplayName;
304+
301305
@SerializedName(ApiConstants.BOOT_MODE)
302306
@Param(description = "Guest vm Boot Mode")
303307
private String bootMode;
@@ -854,6 +858,10 @@ public void setOsTypeId(String osTypeId) {
854858
this.osTypeId = osTypeId;
855859
}
856860

861+
public void setOsDisplayName(String osDisplayName) {
862+
this.osDisplayName = osDisplayName;
863+
}
864+
857865
public Set<Long> getTagIds() {
858866
return tagIds;
859867
}
@@ -882,12 +890,15 @@ public String getOsTypeId() {
882890
return osTypeId;
883891
}
884892

893+
public String getOsDisplayName() {
894+
return osDisplayName;
895+
}
896+
885897
public String getBootType() { return bootType; }
886898

887899
public void setBootType(String bootType) { this.bootType = bootType; }
888900

889901
public String getBootMode() { return bootMode; }
890902

891903
public void setBootMode(String bootMode) { this.bootMode = bootMode; }
892-
893904
}

api/src/main/java/org/apache/cloudstack/api/response/VpcResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons
6767
@Param(description = "vpc offering id the VPC is created from")
6868
private String vpcOfferingId;
6969

70+
@SerializedName(ApiConstants.VPC_OFF_NAME)
71+
@Param(description = "vpc offering name the VPC is created from", since = "4.13.2")
72+
private String vpcOfferingName;
73+
7074
@SerializedName(ApiConstants.CREATED)
7175
@Param(description = "the date this VPC was created")
7276
private Date created;
@@ -184,6 +188,10 @@ public void setVpcOfferingId(final String vpcOfferingId) {
184188
this.vpcOfferingId = vpcOfferingId;
185189
}
186190

191+
public void setVpcOfferingName(final String vpcOfferingName) {
192+
this.vpcOfferingName = vpcOfferingName;
193+
}
194+
187195
public List<NetworkResponse> getNetworks() {
188196
return networks;
189197
}

server/src/main/java/com/cloud/api/ApiResponseHelper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ public IPAddressResponse createIPAddressResponse(ResponseView view, IpAddress ip
875875
Vpc vpc = ApiDBUtils.findVpcById(ipAddr.getVpcId());
876876
if (vpc != null) {
877877
ipResponse.setVpcId(vpc.getUuid());
878+
ipResponse.setVpcName(vpc.getName());
878879
}
879880
}
880881

@@ -1378,11 +1379,13 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) {
13781379
HostPodVO pod = ApiDBUtils.findPodById(vm.getPodIdToDeployIn());
13791380
if (pod != null) {
13801381
vmResponse.setPodId(pod.getUuid());
1382+
vmResponse.setPodName(pod.getName());
13811383
}
13821384
}
13831385
VMTemplateVO template = ApiDBUtils.findTemplateById(vm.getTemplateId());
13841386
if (template != null) {
13851387
vmResponse.setTemplateId(template.getUuid());
1388+
vmResponse.setTemplateName(template.getName());
13861389
}
13871390
vmResponse.setCreated(vm.getCreated());
13881391

@@ -2901,6 +2904,7 @@ public VpcResponse createVpcResponse(ResponseView view, Vpc vpc) {
29012904
VpcOffering voff = ApiDBUtils.findVpcOfferingById(vpc.getVpcOfferingId());
29022905
if (voff != null) {
29032906
response.setVpcOfferingId(voff.getUuid());
2907+
response.setVpcOfferingName(voff.getName());
29042908
}
29052909
response.setCidr(vpc.getCidr());
29062910
response.setRestartRequired(vpc.isRestartRequired());
@@ -2973,6 +2977,7 @@ public PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result
29732977
if (result.getVpcId() != null) {
29742978
Vpc vpc = ApiDBUtils.findVpcById(result.getVpcId());
29752979
response.setVpcId(vpc.getUuid());
2980+
response.setVpcName(vpc.getName());
29762981
}
29772982

29782983
DataCenter zone = ApiDBUtils.findZoneById(result.getZoneId());
@@ -3163,6 +3168,7 @@ public Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVp
31633168
Vpc vpc = ApiDBUtils.findVpcById(result.getVpcId());
31643169
if (vpc != null) {
31653170
response.setVpcId(vpc.getUuid());
3171+
response.setVpcName(vpc.getName());
31663172
}
31673173
response.setRemoved(result.getRemoved());
31683174
response.setForDisplay(result.isDisplay());

server/src/main/java/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@
3030
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
3131
import org.apache.cloudstack.utils.CloudStackVersion;
3232

33+
import com.cloud.api.ApiDBUtils;
3334
import com.cloud.api.ApiResponseHelper;
3435
import com.cloud.api.query.vo.DomainRouterJoinVO;
36+
import com.cloud.dc.HostPodVO;
3537
import com.cloud.network.Networks.TrafficType;
3638
import com.cloud.network.router.VirtualRouter;
3739
import com.cloud.network.router.VirtualRouter.Role;
40+
import com.cloud.storage.VMTemplateVO;
3841
import com.cloud.user.Account;
3942
import com.cloud.user.AccountManager;
4043
import com.cloud.utils.db.GenericDaoBase;
@@ -46,7 +49,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
4649
public static final Logger s_logger = Logger.getLogger(DomainRouterJoinDaoImpl.class);
4750

4851
@Inject
49-
private ConfigurationDao _configDao;
52+
private ConfigurationDao _configDao;
5053
@Inject
5154
public AccountManager _accountMgr;
5255

@@ -74,6 +77,10 @@ public DomainRouterResponse newDomainRouterResponse(DomainRouterJoinVO router, A
7477
routerResponse.setZoneId(router.getDataCenterUuid());
7578
routerResponse.setName(router.getName());
7679
routerResponse.setTemplateId(router.getTemplateUuid());
80+
VMTemplateVO template = ApiDBUtils.findTemplateById(router.getTemplateId());
81+
if (template != null) {
82+
routerResponse.setTemplateName(template.getName());
83+
}
7784
routerResponse.setCreated(router.getCreated());
7885
routerResponse.setState(router.getState());
7986
routerResponse.setIsRedundantRouter(router.isRedundantRouter());
@@ -98,6 +105,10 @@ public DomainRouterResponse newDomainRouterResponse(DomainRouterJoinVO router, A
98105
routerResponse.setHypervisor(router.getHypervisorType().toString());
99106
}
100107
routerResponse.setPodId(router.getPodUuid());
108+
HostPodVO pod = ApiDBUtils.findPodById(router.getPodId());
109+
if (pod != null) {
110+
routerResponse.setPodName(pod.getName());
111+
}
101112
long nic_id = router.getNicId();
102113
if (nic_id > 0) {
103114
TrafficType ty = router.getTrafficType();

0 commit comments

Comments
 (0)