use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method getSubnetById.
/**
* @see com.att.cdp.zones.NetworkService#getSubnetById(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public Subnet getSubnetById(String id) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SUBNET, id);
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
SubnetsResource resource = client.subnets();
for (com.woorea.openstack.quantum.model.Subnet net : resource.list().execute()) {
if (net.getId().equals(id)) {
return new OpenStackSubnet(context, net);
}
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method associateLoadBalancerHealthMonitorWithPool.
/**
* @see com.att.cdp.zones.NetworkService#associateLoadBalancerHealthMonitorWithPool(java.lang.String,
* java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void associateLoadBalancerHealthMonitorWithPool(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().associateMonitor(poolId, healthMonitorId).execute();
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerMembers.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerMembers()
*/
@Override
public List<LoadBalancerMember> getLoadBalancerMembers() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
ArrayList<LoadBalancerMember> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
LoadBalancerResource.Member resource = client.lbaas().Member();
for (com.woorea.openstack.quantum.model.LoadBalancerMember loadBalancerMember : resource.list().execute()) {
list.add(new OpenStackLoadBalancerMember(context, loadBalancerMember));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method deleteSubnet.
/**
* Delete the specified network using it's id.
*
* @param subnet
* The subnet to be deleted.
* @throws ZoneException
* If the network does not exist or cannot be deleted for some reason.
*/
@SuppressWarnings("nls")
@Override
public void deleteSubnet(Subnet subnet) throws ZoneException {
checkArg(subnet, "subnet");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SUBNET, subnet.getId());
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
client.subnets().delete(subnet.getId()).execute();
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method getLoadBalancerHealthMonitors.
/**
* @see com.att.cdp.zones.NetworkService#getLoadBalancerHealthMonitors()
*/
@Override
public List<LoadBalancerHealthMonitor> getLoadBalancerHealthMonitors() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
ArrayList<LoadBalancerHealthMonitor> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
LoadBalancerResource.HealthMonitor resource = client.lbaas().HealthMonitor();
for (com.woorea.openstack.quantum.model.LoadBalancerHealthMonitor loadBalancerHealthMonitor : resource.list().execute()) {
list.add(new OpenStackLoadBalancerHealthMonitor(context, loadBalancerHealthMonitor));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
Aggregations