From b9d834e83854009483f6d061f9996e5ffaa9b883 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Tue, 5 Aug 2014 17:29:34 -0700 Subject: [PATCH] CLOUDSTACK-4200: listSystemVMs API and listRouters API should return hypervisor property since dynamic scaling is not enabled for all the hypervisors and that action can be showed only for the hypervisors that support it. --- .../api/response/DomainRouterResponse.java | 12 ++ .../api/response/SystemVmResponse.java | 12 ++ .../src/com/cloud/api/ApiResponseHelper.java | 1 + .../query/dao/DomainRouterJoinDaoImpl.java | 1 + .../api/query/vo/DomainRouterJoinVO.java | 9 ++ setup/db/db/schema-441to450.sql | 104 ++++++++++++++++++ 6 files changed, 139 insertions(+) diff --git a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java index ed160204619..9225ba02456 100644 --- a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java +++ b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java @@ -85,6 +85,10 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView @Param(description = "the hostname for the router") private String hostName; + @SerializedName("hypervisor") + @Param(description = "the hypervisor on which the template runs") + private String hypervisor; + @SerializedName(ApiConstants.LINK_LOCAL_IP) @Param(description = "the link local IP address for the router") private String linkLocalIp; @@ -262,6 +266,14 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView this.hostName = hostName; } + public String getHypervisor() { + return hypervisor; + } + + public void setHypervisor(String hypervisor) { + this.hypervisor = hypervisor; + } + public void setPublicIp(String publicIp) { this.publicIp = publicIp; } diff --git a/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java b/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java index 8c27c185ebf..9e20b49dfde 100644 --- a/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java +++ b/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java @@ -85,6 +85,10 @@ public class SystemVmResponse extends BaseResponse { @Param(description = "the hostname for the system VM") private String hostName; + @SerializedName("hypervisor") + @Param(description = "the hypervisor on which the template runs") + private String hypervisor; + @SerializedName(ApiConstants.PRIVATE_IP) @Param(description = "the private IP address for the system VM") private String privateIp; @@ -240,6 +244,14 @@ public class SystemVmResponse extends BaseResponse { this.hostName = hostName; } + public String getHypervisor() { + return hypervisor; + } + + public void setHypervisor(String hypervisor) { + this.hypervisor = hypervisor; + } + public String getPrivateIp() { return privateIp; } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 70ed47da49b..221e266b3b2 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1166,6 +1166,7 @@ public class ApiResponseHelper implements ResponseGenerator { if (host != null) { vmResponse.setHostId(host.getUuid()); vmResponse.setHostName(host.getName()); + vmResponse.setHypervisor(host.getHypervisorType().toString()); } } diff --git a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java index 9594c01d375..b054b0e185d 100644 --- a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java @@ -94,6 +94,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase