You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/03/06 20:54:17 UTC
git commit: refs/heads/master - CLOUDSTACK-1402: listRouters API
response doesn't return linklocal IP and public IP details.
Updated Branches:
refs/heads/master aa40c7ee9 -> e31cd2b3d
CLOUDSTACK-1402: listRouters API response doesn't return linklocal IP and public IP details.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e31cd2b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e31cd2b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e31cd2b3
Branch: refs/heads/master
Commit: e31cd2b3d20fcd6f7e42bb44fe38f714aae04003
Parents: aa40c7e
Author: Min Chen <mi...@citrix.com>
Authored: Wed Mar 6 10:11:28 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Mar 6 11:31:52 2013 -0800
----------------------------------------------------------------------
.../api/query/dao/DomainRouterJoinDaoImpl.java | 23 +++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e31cd2b3/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
index cdb859e..488c4e4 100644
--- a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
@@ -170,6 +170,29 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
public DomainRouterResponse setDomainRouterResponse(DomainRouterResponse vrData, DomainRouterJoinVO vr) {
long nic_id = vr.getNicId();
if (nic_id > 0) {
+ TrafficType ty = vr.getTrafficType();
+ if (ty != null) {
+ // legacy code, public/control/guest nic info is kept in
+ // nics response object
+ if (ty == TrafficType.Public) {
+ vrData.setPublicIp(vr.getIpAddress());
+ vrData.setPublicMacAddress(vr.getMacAddress());
+ vrData.setPublicNetmask(vr.getNetmask());
+ vrData.setGateway(vr.getGateway());
+ vrData.setPublicNetworkId(vr.getNetworkUuid());
+ } else if (ty == TrafficType.Control) {
+ vrData.setLinkLocalIp(vr.getIpAddress());
+ vrData.setLinkLocalMacAddress(vr.getMacAddress());
+ vrData.setLinkLocalNetmask(vr.getNetmask());
+ vrData.setLinkLocalNetworkId(vr.getNetworkUuid());
+ } else if (ty == TrafficType.Guest) {
+ vrData.setGuestIpAddress(vr.getIpAddress());
+ vrData.setGuestMacAddress(vr.getMacAddress());
+ vrData.setGuestNetmask(vr.getNetmask());
+ vrData.setGuestNetworkId(vr.getNetworkUuid());
+ vrData.setNetworkDomain(vr.getNetworkDomain());
+ }
+ }
NicResponse nicResponse = new NicResponse();
nicResponse.setId(vr.getNicUuid());
nicResponse.setIpaddress(vr.getIpAddress());