diff --git a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java index 83ec10a9e2d7..910a8adaf1c9 100644 --- a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java @@ -326,6 +326,7 @@ public class ApiConstants { public static final String TARGET_IQN = "targetiqn"; public static final String TEMPLATE_FILTER = "templatefilter"; public static final String TEMPLATE_ID = "templateid"; + public static final String TEMPLATE_NAME = "templatename"; public static final String ISO_ID = "isoid"; public static final String TIMEOUT = "timeout"; public static final String TIMEZONE = "timezone"; @@ -566,8 +567,10 @@ public class ApiConstants { public static final String END_POINT = "endpoint"; public static final String REGION_ID = "regionid"; public static final String VPC_OFF_ID = "vpcofferingid"; + public static final String VPC_OFF_NAME = "vpcofferingname"; public static final String NETWORK = "network"; public static final String VPC_ID = "vpcid"; + public static final String VPC_NAME = "vpcname"; public static final String GATEWAY_ID = "gatewayid"; public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy"; public static final String RESOURCE_IDS = "resourceids"; diff --git a/api/src/main/java/org/apache/cloudstack/api/response/DomainRouterResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/DomainRouterResponse.java index 131e3e1de7ed..f4e9e5219cc5 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/DomainRouterResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/DomainRouterResponse.java @@ -77,6 +77,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView @Param(description = "the Pod ID for the router") private String podId; + @SerializedName(ApiConstants.POD_NAME) + @Param(description = "the Pod name for the router", since = "4.13.2") + private String podName; + @SerializedName(ApiConstants.HOST_ID) @Param(description = "the host ID for the router") private String hostId; @@ -145,6 +149,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView @Param(description = "the template ID for the router") private String templateId; + @SerializedName(ApiConstants.TEMPLATE_NAME) + @Param(description = "the template name for the router", since = "4.13.2") + private String templateName; + @SerializedName(ApiConstants.CREATED) @Param(description = "the date and time the router was created") private Date created; @@ -266,6 +274,10 @@ public void setPodId(String podId) { this.podId = podId; } + public void setPodName(String podName) { + this.podName = podName; + } + public void setHostId(String hostId) { this.hostId = hostId; } @@ -310,6 +322,10 @@ public void setTemplateId(String templateId) { this.templateId = templateId; } + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + public void setCreated(Date created) { this.created = created; } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/IPAddressResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/IPAddressResponse.java index d3d98c87f17b..786fddc4fa2a 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/IPAddressResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/IPAddressResponse.java @@ -136,8 +136,13 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR private String purpose; @SerializedName(ApiConstants.VPC_ID) - @Param(description = "VPC the ip belongs to") + @Param(description = "VPC id the ip belongs to") private String vpcId; + + @SerializedName(ApiConstants.VPC_NAME) + @Param(description = "VPC name the ip belongs to", since = "4.13.2") + private String vpcName; + @SerializedName(ApiConstants.TAGS) @Param(description = "the list of resource tags associated with ip address", responseObject = ResourceTagResponse.class) private List tags; @@ -273,6 +278,10 @@ public void setVpcId(String vpcId) { this.vpcId = vpcId; } + public void setVpcName(String vpcName) { + this.vpcName = vpcName; + } + public void setTags(List tags) { this.tags = tags; } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/PrivateGatewayResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/PrivateGatewayResponse.java index 413497fcd24c..be2faa796d6a 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/PrivateGatewayResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/PrivateGatewayResponse.java @@ -58,9 +58,13 @@ public class PrivateGatewayResponse extends BaseResponse implements ControlledEn private String broadcastUri; @SerializedName(ApiConstants.VPC_ID) - @Param(description = "VPC the private gateaway belongs to") + @Param(description = "VPC id the private gateway belongs to") private String vpcId; + @SerializedName(ApiConstants.VPC_NAME) + @Param(description = "VPC name the private gateway belongs to", since = "4.13.2") + private String vpcName; + @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description = "the physical network id") private String physicalNetworkId; @@ -130,6 +134,10 @@ public void setVpcId(String vpcId) { this.vpcId = vpcId; } + public void setVpcName(String vpcName) { + this.vpcName = vpcName; + } + public void setAddress(String address) { this.address = address; } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java index e7194d73e910..cdd8e4f3d87f 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java @@ -42,6 +42,10 @@ public class Site2SiteVpnGatewayResponse extends BaseResponse implements Control @Param(description = "the vpc id of this gateway") private String vpcId; + @SerializedName(ApiConstants.VPC_NAME) + @Param(description = "the vpc name of this gateway", since = "4.13.2") + private String vpcName; + @SerializedName(ApiConstants.ACCOUNT) @Param(description = "the owner") private String accountName; @@ -82,6 +86,10 @@ public void setVpcId(String vpcId) { this.vpcId = vpcId; } + public void setVpcName(String vpcName) { + this.vpcName = vpcName; + } + public void setRemoved(Date removed) { this.removed = removed; } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java index 3fb17db75325..934e84fe9d0a 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java @@ -78,6 +78,10 @@ public class SystemVmResponse extends BaseResponse { @Param(description = "the Pod ID for the system VM") private String podId; + @SerializedName("podname") + @Param(description = "the Pod name for the system VM", since = "4.13.2") + private String podName; + @SerializedName("hostid") @Param(description = "the host ID for the system VM") private String hostId; @@ -130,6 +134,10 @@ public class SystemVmResponse extends BaseResponse { @Param(description = "the template ID for the system VM") private String templateId; + @SerializedName("templatename") + @Param(description = "the template name for the system VM", since = "4.13.2") + private String templateName; + @SerializedName("created") @Param(description = "the date and time the system VM was created") private Date created; @@ -243,10 +251,18 @@ public String getPodId() { return podId; } + public String getPodName() { + return podName; + } + public void setPodId(String podId) { this.podId = podId; } + public void setPodName(String podName) { + this.podName = podName; + } + public String getHostId() { return hostId; } @@ -323,10 +339,18 @@ public String getTemplateId() { return templateId; } + public String getTemplateName() { + return templateName; + } + public void setTemplateId(String templateId) { this.templateId = templateId; } + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + public Date getCreated() { return created; } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java index 8a2f1a169d64..b37e1c8b4393 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java @@ -290,6 +290,10 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co @Param(description = "OS type id of the vm", since = "4.4") private String osTypeId; + @SerializedName(ApiConstants.OS_DISPLAY_NAME) + @Param(description = "OS name of the vm", since = "4.13.2") + private String osDisplayName; + public UserVmResponse() { securityGroupList = new LinkedHashSet(); nics = new LinkedHashSet(); @@ -822,6 +826,10 @@ public void setOsTypeId(String osTypeId) { this.osTypeId = osTypeId; } + public void setOsDisplayName(String osDisplayName) { + this.osDisplayName = osDisplayName; + } + public Set getTagIds() { return tagIds; } @@ -849,4 +857,8 @@ public void setDynamicallyScalable(Boolean dynamicallyScalable) { public String getOsTypeId() { return osTypeId; } + + public String getOsDisplayName() { + return osDisplayName; + } } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/VpcResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/VpcResponse.java index 61ed88b142cb..9c9f059384e0 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/VpcResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/VpcResponse.java @@ -67,6 +67,10 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons @Param(description = "vpc offering id the VPC is created from") private String vpcOfferingId; + @SerializedName(ApiConstants.VPC_OFF_NAME) + @Param(description = "vpc offering name the VPC is created from", since = "4.13.2") + private String vpcOfferingName; + @SerializedName(ApiConstants.CREATED) @Param(description = "the date this VPC was created") private Date created; @@ -184,6 +188,10 @@ public void setVpcOfferingId(final String vpcOfferingId) { this.vpcOfferingId = vpcOfferingId; } + public void setVpcOfferingName(final String vpcOfferingName) { + this.vpcOfferingName = vpcOfferingName; + } + public List getNetworks() { return networks; } diff --git a/server/src/main/java/com/cloud/api/ApiResponseHelper.java b/server/src/main/java/com/cloud/api/ApiResponseHelper.java index 05c1ab09538f..229b31159b1a 100644 --- a/server/src/main/java/com/cloud/api/ApiResponseHelper.java +++ b/server/src/main/java/com/cloud/api/ApiResponseHelper.java @@ -860,6 +860,7 @@ public IPAddressResponse createIPAddressResponse(ResponseView view, IpAddress ip Vpc vpc = ApiDBUtils.findVpcById(ipAddr.getVpcId()); if (vpc != null) { ipResponse.setVpcId(vpc.getUuid()); + ipResponse.setVpcName(vpc.getName()); } } @@ -1361,11 +1362,13 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) { HostPodVO pod = ApiDBUtils.findPodById(vm.getPodIdToDeployIn()); if (pod != null) { vmResponse.setPodId(pod.getUuid()); + vmResponse.setPodName(pod.getName()); } } VMTemplateVO template = ApiDBUtils.findTemplateById(vm.getTemplateId()); if (template != null) { vmResponse.setTemplateId(template.getUuid()); + vmResponse.setTemplateName(template.getName()); } vmResponse.setCreated(vm.getCreated()); @@ -2884,6 +2887,7 @@ public VpcResponse createVpcResponse(ResponseView view, Vpc vpc) { VpcOffering voff = ApiDBUtils.findVpcOfferingById(vpc.getVpcOfferingId()); if (voff != null) { response.setVpcOfferingId(voff.getUuid()); + response.setVpcOfferingName(voff.getName()); } response.setCidr(vpc.getCidr()); response.setRestartRequired(vpc.isRestartRequired()); @@ -2956,6 +2960,7 @@ public PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result if (result.getVpcId() != null) { Vpc vpc = ApiDBUtils.findVpcById(result.getVpcId()); response.setVpcId(vpc.getUuid()); + response.setVpcName(vpc.getName()); } DataCenter zone = ApiDBUtils.findZoneById(result.getZoneId()); @@ -3146,6 +3151,7 @@ public Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVp Vpc vpc = ApiDBUtils.findVpcById(result.getVpcId()); if (vpc != null) { response.setVpcId(vpc.getUuid()); + response.setVpcName(vpc.getName()); } response.setRemoved(result.getRemoved()); response.setForDisplay(result.isDisplay()); diff --git a/server/src/main/java/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java index 8252a2a5a18f..413ff2a56149 100644 --- a/server/src/main/java/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java @@ -30,11 +30,14 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.utils.CloudStackVersion; +import com.cloud.api.ApiDBUtils; import com.cloud.api.ApiResponseHelper; import com.cloud.api.query.vo.DomainRouterJoinVO; +import com.cloud.dc.HostPodVO; import com.cloud.network.Networks.TrafficType; import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.Role; +import com.cloud.storage.VMTemplateVO; import com.cloud.user.Account; import com.cloud.user.AccountManager; import com.cloud.utils.db.GenericDaoBase; @@ -46,7 +49,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase 0) { TrafficType ty = router.getTrafficType(); diff --git a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java index 4ccfce9edb48..08269a6d9dc4 100644 --- a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java @@ -48,6 +48,7 @@ import com.cloud.api.query.vo.UserVmJoinVO; import com.cloud.gpu.GPU; import com.cloud.service.ServiceOfferingDetailsVO; +import com.cloud.storage.GuestOS; import com.cloud.user.Account; import com.cloud.user.AccountManager; import com.cloud.user.User; @@ -68,7 +69,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation