use of com.woorea.openstack.quantum.api.RoutersResource in project AJSC by att.
the class OpenStackNetworkService method getRouters.
/**
* @return List<Router>
* @throws ZoneException
* If the context cannot be used to get the list or routers
* @see com.att.cdp.zones.NetworkService#getRouters()
*/
@SuppressWarnings("nls")
@Override
public List<Router> getRouters() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Network");
RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
ArrayList<Router> list = new ArrayList<>();
try {
Quantum client = quantumConnector.getClient();
RoutersResource resource = client.routers();
for (com.woorea.openstack.quantum.model.Router openstackRouter : resource.list().execute().getList()) {
Router r = new OpenStackRouter(context, openstackRouter);
list.add(r);
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
Aggregations