Repository: cloudstack
Updated Branches:
  refs/heads/master 48aa7e185 -> 93429443d


CLOUDSTACK-8063: list secondary Ips information on non-default nics in VM 
response


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

Branch: refs/heads/master
Commit: 93429443d50eabd5c6e73a412b8935120e13c42d
Parents: 48aa7e1
Author: Wei Zhou <w.z...@tech.leaseweb.com>
Authored: Mon Jan 5 11:22:14 2015 +0100
Committer: Wei Zhou <w.z...@tech.leaseweb.com>
Committed: Mon Jan 5 11:22:14 2015 +0100

----------------------------------------------------------------------
 .../src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93429443/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 8ea142a..890b4bc 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -358,6 +358,18 @@ public class UserVmJoinDaoImpl extends 
GenericDaoBase<UserVmJoinVO, Long> implem
                 nicResponse.setType(uvo.getGuestType().toString());
             }
             nicResponse.setIsDefault(uvo.isDefaultNic());
+            List<NicSecondaryIpVO> secondaryIps = 
ApiDBUtils.findNicSecondaryIps(uvo.getNicId());
+            if (secondaryIps != null) {
+                List<NicSecondaryIpResponse> ipList = new 
ArrayList<NicSecondaryIpResponse>();
+                for (NicSecondaryIpVO ip : secondaryIps) {
+                    NicSecondaryIpResponse ipRes = new 
NicSecondaryIpResponse();
+                    ipRes.setId(ip.getUuid());
+                    ipRes.setIpAddr(ip.getIp4Address());
+                    ipList.add(ipRes);
+                }
+                nicResponse.setSecondaryIps(ipList);
+            }
+
             nicResponse.setObjectName("nic");
             userVmData.addNic(nicResponse);
         }

Reply via email to