Search in sources :

Example 1 with ExtensionsResource

use of com.woorea.openstack.nova.api.ExtensionsResource in project AJSC by att.

the class OpenStackNetworkService method getNetworkExtensions.

/**
 * @return List of extensions
 * @throws ZoneException
 *             If the context cannot be used to obtain the list of extensions
 * @see com.att.cdp.zones.NetworkService#getNetworks()
 */
@SuppressWarnings("nls")
public List<Extension> getNetworkExtensions() throws ZoneException {
    connect();
    trackRequest();
    RequestState.put(RequestState.SERVICE, "Network");
    RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint());
    ArrayList<Extension> list = new ArrayList<>();
    try {
        Quantum client = quantumConnector.getClient();
        ExtensionsResource res = new ExtensionsResource(client);
        for (com.woorea.openstack.nova.model.Extension ext : res.list(false).execute()) {
            list.add(ext);
        }
    } catch (OpenStackBaseException e) {
        ExceptionMapper.mapException(e);
    }
    return list;
}
Also used : Extension(com.woorea.openstack.nova.model.Extension) FloatingIpsExtension(com.woorea.openstack.nova.api.extensions.FloatingIpsExtension) Quantum(com.woorea.openstack.quantum.Quantum) Extension(com.woorea.openstack.nova.model.Extension) OpenStackBaseException(com.woorea.openstack.base.client.OpenStackBaseException) ArrayList(java.util.ArrayList) ExtensionsResource(com.woorea.openstack.nova.api.ExtensionsResource)

Aggregations

OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)1 ExtensionsResource (com.woorea.openstack.nova.api.ExtensionsResource)1 FloatingIpsExtension (com.woorea.openstack.nova.api.extensions.FloatingIpsExtension)1 Extension (com.woorea.openstack.nova.model.Extension)1 Quantum (com.woorea.openstack.quantum.Quantum)1 ArrayList (java.util.ArrayList)1