use of com.woorea.openstack.quantum.api.PortsResource 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);
}
use of com.woorea.openstack.quantum.api.PortsResource 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;
}
Aggregations