public static String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) { for(Service service : serviceCatalog) { if(type.equals(service.getType())) { for(Service.Endpoint endpoint : service.getEndpoints()) { if(region == null || region.equals(endpoint.getRegion())) { if(endpoint.getPublicURL() != null && facing.equals("public")) { return endpoint.getPublicURL(); } else if(endpoint.getInternalURL() != null && facing.equals("internal")) { return endpoint.getInternalURL(); } else if(endpoint.getAdminURL() != null && facing.equals("admin")) { return endpoint.getAdminURL(); } } } } } throw new RuntimeException("endpoint url not found"); }
public static String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) { for(Service service : serviceCatalog) { if(type.equals(service.getType())) { for(Service.Endpoint endpoint : service.getEndpoints()) { if(region == null || region.equals(endpoint.getRegion())) { if(endpoint.getPublicURL() != null && facing.equals("public")) { return endpoint.getPublicURL(); } else if(endpoint.getInternalURL() != null && facing.equals("internal")) { return endpoint.getInternalURL(); } else if(endpoint.getAdminURL() != null && facing.equals("admin")) { return endpoint.getAdminURL(); } } } } } throw new RuntimeException("endpoint url not found"); }
public static String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) { for(Service service : serviceCatalog) { if(type.equals(service.getType())) { for(Service.Endpoint endpoint : service.getEndpoints()) { if(region == null || region.equals(endpoint.getRegion())) { if(endpoint.getPublicURL() != null && facing.equals("public")) { return endpoint.getPublicURL(); } else if(endpoint.getInternalURL() != null && facing.equals("internal")) { return endpoint.getInternalURL(); } else if(endpoint.getAdminURL() != null && facing.equals("admin")) { return endpoint.getAdminURL(); } } } } } throw new RuntimeException("endpoint url not found"); }
discoveredServices.put(type, entry); List<Access.Service.Endpoint> endpoints = service.getEndpoints(); for (Access.Service.Endpoint endpoint : endpoints) { String adminUrl = endpoint.getAdminURL();
for (Endpoint endpoint : glanceService.getEndpoints()) { Glance glance = new Glance(endpoint.getPublicURL() + "/v1"); glance.setTokenProvider(keystone