Search in sources :

Example 1 with VLANResource

use of com.woorea.openstack.quantum.api.VLANResource in project AJSC by att.

the class OpenStackNetworkService method getVLANTransparency.

/**
 * @see com.att.cdp.zones.NetworkService#getVLANTransparency()
 */
@SuppressWarnings("nls")
@Override
public List<Network> getVLANTransparency() throws ZoneException {
    connect();
    Context context = getContext();
    trackRequest();
    RequestState.put(RequestState.SERVICE, "Network");
    RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
    ArrayList<Network> list = new ArrayList<>();
    try {
        Quantum client = quantumConnector.getClient();
        VLANResource resource = client.vlans();
        for (com.woorea.openstack.quantum.model.Network net : resource.list().execute()) {
            list.add(new OpenStackNetwork(context, net));
        }
    } catch (OpenStackBaseException e) {
        ExceptionMapper.mapException(e);
    }
    return list;
}
Also used : Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext) Quantum(com.woorea.openstack.quantum.Quantum) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException) Network(com.att.cdp.zones.model.Network) AbstractNetwork(com.att.cdp.zones.spi.AbstractNetwork) OpenStackNetwork(com.att.cdp.openstack.model.OpenStackNetwork) ArrayList(java.util.ArrayList) VLANResource(com.woorea.openstack.quantum.api.VLANResource) OpenStackNetwork(com.att.cdp.openstack.model.OpenStackNetwork)

Aggregations

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