CLOUDSTACK-1402: listRouters API response doesn't return linklocal IP and public IP details.

This commit is contained in:
Min Chen 2013-03-06 10:11:28 -08:00
parent aa40c7ee98
commit e31cd2b3d2
1 changed files with 23 additions and 0 deletions

View File

@ -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());