use of com.att.cdp.zones.model.Router 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;
}
use of com.att.cdp.zones.model.Router in project AJSC by att.
the class TestNetworkService method testGetRouters.
/**
* Verifies that we can get ports
*
* @throws ZoneException
* If the connection fails, user is not authorized, or the provider cannot perform the operation.
*/
@Test
@Ignore
public void testGetRouters() throws ZoneException {
Context context = connect();
NetworkService service = context.getNetworkService();
List<Router> routers = service.getRouters();
assertNotNull(routers);
assertFalse(routers.isEmpty());
}
Aggregations