return networks;
}
@Override
public F5LoadBalancerResponse createF5LoadBalancerResponse(ExternalLoadBalancerDeviceVO lbDeviceVO) {
F5LoadBalancerResponse response = new F5LoadBalancerResponse();
Host lbHost = _hostDao.findById(lbDeviceVO.getHostId());
Map<String, String> lbDetails = _detailsDao.findDetails(lbDeviceVO.getHostId());
response.setId(lbDeviceVO.getUuid());
response.setIpAddress(lbHost.getPrivateIpAddress());
PhysicalNetwork pnw = ApiDBUtils.findPhysicalNetworkById(lbDeviceVO.getPhysicalNetworkId());
if (pnw != null) {
response.setPhysicalNetworkId(pnw.getUuid());
}
response.setPublicInterface(lbDetails.get("publicInterface"));
response.setPrivateInterface(lbDetails.get("privateInterface"));
response.setDeviceName(lbDeviceVO.getDeviceName());
if (lbDeviceVO.getCapacity() == 0) {
long defaultLbCapacity = NumbersUtil.parseLong(_configDao.getValue(Config.DefaultExternalLoadBalancerCapacity.key()), 50);
response.setDeviceCapacity(defaultLbCapacity);
} else {
response.setDeviceCapacity(lbDeviceVO.getCapacity());
}
response.setDedicatedLoadBalancer(lbDeviceVO.getIsDedicatedDevice());
response.setProvider(lbDeviceVO.getProviderName());
response.setDeviceState(lbDeviceVO.getState().name());
response.setObjectName("f5loadbalancer");
return response;
}