cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/master to 526af5e
Date Thu, 26 Dec 2013 22:42:24 GMT
Updated Branches:
  refs/heads/master fead6706f -> 526af5e32


Included guestOsId to userVmResponse - as we let to change this param through updateVm call,
we should return it in the response


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/526af5e3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/526af5e3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/526af5e3

Branch: refs/heads/master
Commit: 526af5e326ed8720cf84d9212dcf105d16be736a
Parents: fead670
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Dec 26 13:27:44 2013 -0800
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Dec 26 13:28:29 2013 -0800

----------------------------------------------------------------------
 .../cloudstack/api/response/UserVmResponse.java       | 14 +++++++++++---
 .../com/cloud/api/query/dao/UserVmJoinDaoImpl.java    |  9 ++++-----
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526af5e3/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
index 3ca2a1c..5e65930 100644
--- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
@@ -21,8 +21,6 @@ import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 
-import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
@@ -32,6 +30,7 @@ import com.cloud.network.router.VirtualRouter;
 import com.cloud.serializer.Param;
 import com.cloud.uservm.UserVm;
 import com.cloud.vm.VirtualMachine;
+import com.google.gson.annotations.SerializedName;
 
 @SuppressWarnings("unused")
 @EntityReference(value = {VirtualMachine.class, UserVm.class, VirtualRouter.class})
@@ -229,7 +228,7 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
     private Set<ResourceTagResponse> tags;
 
     @SerializedName(ApiConstants.DETAILS)
-    @Param(description = "Template details in key/value pairs.", since = "4.2.1")
+    @Param(description = "Vm details in key/value pairs.", since = "4.2.1")
     private Map details;
 
     @SerializedName(ApiConstants.SSH_KEYPAIR)
@@ -247,10 +246,15 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
     @SerializedName(ApiConstants.IS_DYNAMICALLY_SCALABLE)
     @Param(description = "true if vm contains XS/VMWare tools inorder to support dynamic
scaling of VM cpu/memory.")
     private Boolean isDynamicallyScalable;
+
     @SerializedName(ApiConstants.SERVICE_STATE)
     @Param(description = "State of the Service from LB rule")
     private String serviceState;
 
+    @SerializedName(ApiConstants.OS_TYPE_ID)
+    @Param(description = "OS type id of the vm", since = "4.4")
+    private Long osTypeId;
+
     public UserVmResponse() {
         securityGroupList = new LinkedHashSet<SecurityGroupResponse>();
         nics = new LinkedHashSet<NicResponse>();
@@ -715,4 +719,8 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
     public void setDetails(Map details) {
         this.details = details;
     }
+
+    public void setOsTypeId(Long osTypeId) {
+        this.osTypeId = osTypeId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/526af5e3/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
index 3e218ec..d1cb531 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -28,15 +28,14 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
 import org.apache.cloudstack.api.response.NicResponse;
 import org.apache.cloudstack.api.response.SecurityGroupResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.api.ApiDBUtils;
 import com.cloud.api.query.vo.ResourceTagJoinVO;
@@ -164,6 +163,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO,
Long> implem
         userVmResponse.setPublicIpId(userVm.getPublicIpUuid());
         userVmResponse.setPublicIp(userVm.getPublicIpAddress());
         userVmResponse.setKeyPairName(userVm.getKeypairName());
+        userVmResponse.setOsTypeId(userVm.getGuestOsId());
 
         if (details.contains(VMDetails.all) || details.contains(VMDetails.stats)) {
             // stats calculation
@@ -175,8 +175,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO,
Long> implem
 
                 userVmResponse.setNetworkKbsWrite((long)vmStats.getNetworkWriteKBs());
 
-                if ((userVm.getHypervisorType() != null) &&
-                    (userVm.getHypervisorType().equals(HypervisorType.KVM) || userVm.getHypervisorType().equals(HypervisorType.XenServer)))
{ // support KVM and XenServer only util 2013.06.25
+                if ((userVm.getHypervisorType() != null) && (userVm.getHypervisorType().equals(HypervisorType.KVM)
|| userVm.getHypervisorType().equals(HypervisorType.XenServer))) { // support KVM and XenServer
only util 2013.06.25
                     userVmResponse.setDiskKbsRead((long)vmStats.getDiskReadKBs());
 
                     userVmResponse.setDiskKbsWrite((long)vmStats.getDiskWriteKBs());


Mime
View raw message