use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method deleteLoadBalancerPool.
/**
* @see com.att.cdp.zones.NetworkService#deleteLoadBalancerPool(com.att.cdp.zones.model.LoadBalancerPool)
*/
@SuppressWarnings("nls")
@Override
public void deleteLoadBalancerPool(LoadBalancerPool loadBalancerPool) throws ZoneException {
checkArg(loadBalancerPool, "loadBalancerPool");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.LOADBALANCERPOOL, loadBalancerPool.getId());
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
LoadBalancerResource.Pool resource = client.lbaas().Pool();
LoadBalancerResource.Pool.Delete deleRes = resource.delete(loadBalancerPool.getId());
deleRes.execute();
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method createNetwork.
@SuppressWarnings("nls")
@Override
public Network createNetwork(Network network) throws ZoneException {
checkArg(network, "network");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.NETWORK, network.getName());
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
com.woorea.openstack.quantum.model.Network netcreate = new com.woorea.openstack.quantum.model.Network();
netcreate.setName(network.getName());
netcreate.setAdminStateUp(true);
com.woorea.openstack.quantum.model.Network openstackNetwork = client.networks().create(netcreate).execute();
return new OpenStackNetwork(context, openstackNetwork);
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method getSubnets.
/**
* @see com.att.cdp.zones.NetworkService#getSubnets()
*/
@SuppressWarnings("nls")
@Override
public List<Subnet> getSubnets() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
ArrayList<Subnet> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
SubnetsResource resource = client.subnets();
for (com.woorea.openstack.quantum.model.Subnet net : resource.list().execute()) {
list.add(new OpenStackSubnet(context, net));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method getPorts.
/**
* @see com.att.cdp.zones.NetworkService#getPorts()
*/
@SuppressWarnings("nls")
@Override
public List<com.att.cdp.zones.model.Port> getPorts() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
List<com.att.cdp.zones.model.Port> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
PortsResource resource = client.ports();
for (com.woorea.openstack.quantum.model.Port p : resource.list().execute()) {
list.add(new OpenStackPort(context, p));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.woorea.openstack.quantum.Quantum in project AJSC by att.
the class OpenStackNetworkService method deleteLoadBalancerListener.
/**
* @see com.att.cdp.zones.NetworkService#deleteLoadBalancerListener(com.att.cdp.zones.model.LoadBalancerListener)
*/
@SuppressWarnings("nls")
@Override
public void deleteLoadBalancerListener(LoadBalancerListener loadBalancerListener) throws ZoneException {
checkArg(loadBalancerListener, "loadBalancerListener");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.LOADBALANCERLISTENER, loadBalancerListener.getId());
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
try {
Quantum client = quantumConnector.getClient();
client.lbaas().VIP().delete(loadBalancerListener.getId()).execute();
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
}
Aggregations