Search in sources :

Example 6 with OpenStackNetwork

use of com.att.cdp.openstack.model.OpenStackNetwork in project AJSC by att.

the class OpenStackNetworkService method getNetworkById.

/**
 * @see com.att.cdp.zones.NetworkService#getNetworkById(java.lang.String)
 */
@SuppressWarnings("nls")
@Override
public Network getNetworkById(String id) throws ZoneException {
    checkArg(id, "id");
    connect();
    Context context = getContext();
    trackRequest();
    RequestState.put(RequestState.NETWORK, id);
    RequestState.put(RequestState.SERVICE, "Network");
    RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
    try {
        com.woorea.openstack.quantum.model.Network n = quantumConnector.getClient().networks().show(id).execute();
        return new OpenStackNetwork(context, n);
    } catch (OpenStackBaseException ex) {
        ExceptionMapper.mapException(ex);
    }
    // for the compiler
    return null;
}
Also used : Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException) OpenStackNetwork(com.att.cdp.openstack.model.OpenStackNetwork)

Aggregations

OpenStackContext (com.att.cdp.openstack.OpenStackContext)6 OpenStackNetwork (com.att.cdp.openstack.model.OpenStackNetwork)6 Context (com.att.cdp.zones.Context)6 OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)6 Network (com.att.cdp.zones.model.Network)5 AbstractNetwork (com.att.cdp.zones.spi.AbstractNetwork)4 Quantum (com.woorea.openstack.quantum.Quantum)4 ArrayList (java.util.ArrayList)4 NetworksResource (com.woorea.openstack.quantum.api.NetworksResource)2 VLANResource (com.woorea.openstack.quantum.api.VLANResource)1