Context context = getContext(); FloatingIps ips = client.floatingIps().list().execute(); for (FloatingIp ip : ips.getList()) { if (pool == null || pool.equalsIgnoreCase(ip.getPool())) {
FloatingIps ips = extension.list().execute(); for (FloatingIp ip : ips) { if (ip.getPool().equalsIgnoreCase(pool)) {
/** * @see com.att.cdp.zones.NetworkService#getFloatingIpPools() */ @SuppressWarnings("nls") @Override public List<String> getFloatingIpPools() throws ZoneException { HashSet<String> pools = new HashSet<>(); connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, novaConnector.getEndpoint()); FloatingIpsExtension extension = novaConnector.getClient().floatingIps(); if (extension == null) { throw new NotSupportedException(EELFResourceManager.format(OSMsg.PAL_OS_UNSUPPORTED_OPERATION, "getAvailableAddresses", context.getProvider().getName())); } try { for (FloatingIp ip : extension.list().execute()) { if (!pools.contains(ip.getPool())) { pools.add(ip.getPool()); } } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return Collections.list(Collections.enumeration(pools)); }
public List list() { return new List(); }
public List list() { return new List(); }
private static synchronized FloatingIp requestFloatingIp(Nova novaClient, String serverId) { FloatingIps ips = novaClient.floatingIps().list().execute(); FloatingIp ip = null; for(FloatingIp ip2 : ips) { // Look for an IP that is not yet associated to a VM if(ip2.getInstanceId() == null && ipAssociations.get(ip2.getId()) == null) { ip = ip2; ipAssociations.put(ip2.getId(), serverId); break; } } return ip; }