use of com.woorea.openstack.base.client.OpenStackBaseException in project AJSC by att.
the class OpenStackNetworkService method getFloatingIpPools.
/**
* @see com.att.cdp.zones.NetworkService#getFloatingIpPools()
*/
@SuppressWarnings("nls")
@Override
public List<String> getFloatingIpPools() throws ZoneException {
HashSet<String> pools = new HashSet<>();
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, novaConnector.getEndpoint());
FloatingIpsExtension extension = novaConnector.getClient().floatingIps();
if (extension == null) {
throw new NotSupportedException(EELFResourceManager.format(OSMsg.PAL_OS_UNSUPPORTED_OPERATION, "getAvailableAddresses", context.getProvider().getName()));
}
try {
for (FloatingIp ip : extension.list().execute()) {
if (!pools.contains(ip.getPool())) {
pools.add(ip.getPool());
}
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return Collections.list(Collections.enumeration(pools));
}
use of com.woorea.openstack.base.client.OpenStackBaseException in project AJSC by att.
the class OpenStackNetworkService method disassociateLoadBalancerHealthMonitorWithPool.
/**
* @see com.att.cdp.zones.NetworkService#disassociateLoadBalancerHealthMonitorWithPool(java.lang.String,
* java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void disassociateLoadBalancerHealthMonitorWithPool(String poolId, String healthMonitorId) throws ZoneException {
checkArg(poolId, "poolId");
checkArg(healthMonitorId, "healthMonitorId");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.LOADBALANCERPOOL, poolId);
RequestState.put(RequestState.LOADBALANCERHEALTHMONITOR, healthMonitorId);
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
client.lbaas().Pool().disassociateMonitor(poolId, healthMonitorId).execute();
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
}
use of com.woorea.openstack.base.client.OpenStackBaseException in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerListenerById.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerListenerById(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public LoadBalancerListener getLoadBalancerListenerById(String id) throws ZoneException {
checkArg(id, "id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.LOADBALANCERLISTENER, id);
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
com.woorea.openstack.quantum.model.LoadBalancerVIP n = quantumConnector.getClient().lbaas().VIP().show(id).execute();
return new OpenStackLoadBalancerVIP(context, n);
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return null;
}
use of com.woorea.openstack.base.client.OpenStackBaseException in project AJSC by att.
the class OpenStackNetworkService method getSubnetsByName.
/**
* @see com.att.cdp.zones.NetworkService#getSubnetsByName(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public List<Subnet> getSubnetsByName(String name) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SUBNET, name);
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
List<Subnet> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
SubnetsResource resource = client.subnets();
for (com.woorea.openstack.quantum.model.Subnet net : resource.list().execute()) {
if (net.getName().equals(name)) {
list.add(new OpenStackSubnet(context, net));
}
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.woorea.openstack.base.client.OpenStackBaseException in project AJSC by att.
the class OpenStackNetworkService method getPort.
/**
* @see com.att.cdp.zones.NetworkService#getPort(java.lang.String)
*/
@Override
public Port getPort(String id) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
RequestState.put(RequestState.PORT, id);
com.woorea.openstack.quantum.model.Port p = null;
try {
Quantum client = quantumConnector.getClient();
PortsResource resource = client.ports();
p = resource.show(id).execute();
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return new OpenStackPort(context, p);
}
Aggregations