/** * @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; }
public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); EXTENSIONS = new ExtensionsResource(this); SERVERS = new ServersResource(this); IMAGES = new ImagesResource(this); FLAVORS = new FlavorsResource(this); KEY_PAIRS = new KeyPairsExtension(this); FLOATING_IPS = new FloatingIpsExtension(this); SECURITY_GROUPS = new SecurityGroupsExtension(this); SNAPSHOTS = new SnapshotsExtension(this); VOLUMES = new VolumesExtension(this); AGGREGATES = new AggregatesExtension(this); QUOTA_SETS = new QuotaSetsResource(this); HOSTS = new HostsExtension(this); SERVICES = new ServicesResource(this); HYPERVISORS = new HypervisorsResource(this); }
/** * Returns the set of extensions loaded, if any * * @return The list of extensions installed, if any * @throws ZoneException * If anything fails */ public List<String> getExtensions() throws ZoneException { connect(); trackRequest(); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); ArrayList<String> extensions = new ArrayList<>(); try { for (Extension extension : nova.getClient().extensions().list(true).execute()) { extensions.add(extension.getName()); } } catch (OpenStackBaseException ex) { if (ex instanceof OpenStackResponseException) { OpenStackResponseException osre = (OpenStackResponseException) ex; if (osre.getStatus() != 404) { ExceptionMapper.mapException(ex); } } else { ExceptionMapper.mapException(ex); } } return extensions; }
public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); EXTENSIONS = new ExtensionsResource(this); SERVERS = new ServersResource(this); IMAGES = new ImagesResource(this); FLAVORS = new FlavorsResource(this); KEY_PAIRS = new KeyPairsExtension(this); FLOATING_IPS = new FloatingIpsExtension(this); SECURITY_GROUPS = new SecurityGroupsExtension(this); SNAPSHOTS = new SnapshotsExtension(this); VOLUMES = new VolumesExtension(this); AGGREGATES = new AggregatesExtension(this); QUOTA_SETS = new QuotaSetsResource(this); HOSTS = new HostsExtension(this); SERVICES = new ServicesResource(this); HYPERVISORS = new HypervisorsResource(this); NETWORKS = new NetworksExtension(this); }
for (Extension extension : nova.getClient().extensions().list(true) .execute()) { extensions.add(extension.getName());