use of com.woorea.openstack.quantum.model.Network in project so by onap.
the class MsoNeutronUtils method findNetworkById.
/*
* Find a network (or query its existence) by its Id.
*
* @param neutronClient an authenticated Quantum object
*
* @param networkId the network ID to query
*
* @return a Network object or null if not found
*/
private Network findNetworkById(Quantum neutronClient, String networkId) {
if (networkId == null) {
return null;
}
try {
OpenStackRequest<Network> request = neutronClient.networks().show(networkId);
Network network = executeAndRecordOpenstackRequest(request);
return network;
} catch (OpenStackResponseException e) {
if (e.getStatus() == 404) {
return null;
} else {
logger.error("{} {} Openstack Error, GET Network By ID ({}): ", MessageEnum.RA_CONNECTION_EXCEPTION, ErrorCode.DataError.getValue(), networkId, e);
throw e;
}
}
}
Aggregations