use of com.cloud.network.resource.F5BigIpResource in project cloudstack by apache.
the class F5ExternalLoadBalancerElement method addExternalLoadBalancer.
@Override
@Deprecated
public Host addExternalLoadBalancer(AddExternalLoadBalancerCmd cmd) {
Long zoneId = cmd.getZoneId();
DataCenterVO zone = null;
PhysicalNetworkVO pNetwork = null;
ExternalLoadBalancerDeviceVO lbDeviceVO = null;
HostVO lbHost = null;
zone = _dcDao.findById(zoneId);
if (zone == null) {
throw new InvalidParameterValueException("Could not find zone with ID: " + zoneId);
}
List<PhysicalNetworkVO> physicalNetworks = _physicalNetworkDao.listByZone(zoneId);
if ((physicalNetworks == null) || (physicalNetworks.size() > 1)) {
throw new InvalidParameterValueException("There are no physical networks or multiple physical networks configured in zone with ID: " + zoneId + " to add this device.");
}
pNetwork = physicalNetworks.get(0);
String deviceType = NetworkDevice.F5BigIpLoadBalancer.getName();
lbDeviceVO = addExternalLoadBalancer(pNetwork.getId(), cmd.getUrl(), cmd.getUsername(), cmd.getPassword(), deviceType, new F5BigIpResource(), false, false, null, null);
if (lbDeviceVO != null) {
lbHost = _hostDao.findById(lbDeviceVO.getHostId());
}
return lbHost;
}
Aggregations