@@ -1701,8 +1701,10 @@ public DomainRouterResponse createDomainRouterResponse(VirtualRouter router) {
17011701 }
17021702 routerResponse .setPodId (router .getPodIdToDeployIn ());
17031703 List <NicProfile > nicProfiles = ApiDBUtils .getNics (router );
1704+ List <NicResponse > nicResponses = new ArrayList <NicResponse >();
17041705 for (NicProfile singleNicProfile : nicProfiles ) {
17051706 Network network = ApiDBUtils .findNetworkById (singleNicProfile .getNetworkId ());
1707+ //legacy code, public/control/guest nic info is kept in nics response object
17061708 if (network != null ) {
17071709 if (network .getTrafficType () == TrafficType .Public ) {
17081710 routerResponse .setPublicIp (singleNicProfile .getIp4Address ());
@@ -1722,8 +1724,32 @@ public DomainRouterResponse createDomainRouterResponse(VirtualRouter router) {
17221724 routerResponse .setGuestNetworkId (singleNicProfile .getNetworkId ());
17231725 routerResponse .setNetworkDomain (network .getNetworkDomain ());
17241726 }
1727+
1728+ NicResponse nicResponse = new NicResponse ();
1729+ nicResponse .setId (singleNicProfile .getId ());
1730+ nicResponse .setIpaddress (singleNicProfile .getIp4Address ());
1731+ nicResponse .setGateway (singleNicProfile .getGateway ());
1732+ nicResponse .setNetmask (singleNicProfile .getNetmask ());
1733+ nicResponse .setNetworkid (singleNicProfile .getNetworkId ());
1734+ nicResponse .setNetworkName (network .getName ());
1735+
1736+ if (singleNicProfile .getBroadCastUri () != null ) {
1737+ nicResponse .setBroadcastUri (singleNicProfile .getBroadCastUri ().toString ());
1738+ }
1739+ if (singleNicProfile .getIsolationUri () != null ) {
1740+ nicResponse .setIsolationUri (singleNicProfile .getIsolationUri ().toString ());
1741+ }
1742+
1743+ nicResponse .setTrafficType (network .getTrafficType ().toString ());
1744+ if (network .getGuestType () != null ) {
1745+ nicResponse .setType (network .getGuestType ().toString ());
1746+ }
1747+ nicResponse .setIsDefault (singleNicProfile .isDefaultNic ());
1748+ nicResponse .setObjectName ("nic" );
1749+ nicResponses .add (nicResponse );
17251750 }
17261751 }
1752+ routerResponse .setNics (nicResponses );
17271753 }
17281754
17291755 // Service Offering Info
@@ -3892,4 +3918,4 @@ public Site2SiteVpnConnectionResponse createSite2SiteVpnConnectionResponse(Site2
38923918 response .setObjectName ("vpnconnection" );
38933919 return response ;
38943920 }
3895- }
3921+ }
0 commit comments