/** Unlike EC2, you cannot default GCE instances to a region. Hence, we constrain to zones. */ @Override public Iterable<Location> listLocations() { Location provider = justProvider.get().iterator().next(); ImmutableList.Builder<Location> zones = ImmutableList.builder(); for (Region region : concat(api.regions().list())) { Location regionLocation = new LocationBuilder() .scope(LocationScope.REGION) .id(region.name()) .description(region.selfLink().toString()) .parent(provider).build(); for (URI zoneSelfLink : region.zones()) { String zoneName = toName(zoneSelfLink); zones.add(new LocationBuilder() .scope(LocationScope.ZONE) .id(zoneName) .description(zoneSelfLink.toString()) .parent(regionLocation).build()); } } return zones.build(); }
/** Unlike EC2, you cannot default GCE instances to a region. Hence, we constrain to zones. */ @Override public Iterable<Location> listLocations() { Location provider = justProvider.get().iterator().next(); ImmutableList.Builder<Location> zones = ImmutableList.builder(); for (Region region : concat(api.regions().list())) { Location regionLocation = new LocationBuilder() .scope(LocationScope.REGION) .id(region.name()) .description(region.selfLink().toString()) .parent(provider).build(); for (URI zoneSelfLink : region.zones()) { String zoneName = toName(zoneSelfLink); zones.add(new LocationBuilder() .scope(LocationScope.ZONE) .id(zoneName) .description(zoneSelfLink.toString()) .parent(regionLocation).build()); } } return zones.build(); }
/** Unlike EC2, you cannot default GCE instances to a region. Hence, we constrain to zones. */ @Override public Iterable<Location> listLocations() { Location provider = justProvider.get().iterator().next(); ImmutableList.Builder<Location> zones = ImmutableList.builder(); for (Region region : concat(api.regions().list())) { Location regionLocation = new LocationBuilder() .scope(LocationScope.REGION) .id(region.name()) .description(region.selfLink().toString()) .parent(provider).build(); for (URI zoneSelfLink : region.zones()) { String zoneName = toName(zoneSelfLink); zones.add(new LocationBuilder() .scope(LocationScope.ZONE) .id(zoneName) .description(zoneSelfLink.toString()) .parent(regionLocation).build()); } } return zones.build(); }
/** Unlike EC2, you cannot default GCE instances to a region. Hence, we constrain to zones. */ @Override public Iterable<Location> listLocations() { Location provider = justProvider.get().iterator().next(); ImmutableList.Builder<Location> zones = ImmutableList.builder(); for (Region region : concat(api.regions().list())) { Location regionLocation = new LocationBuilder() .scope(LocationScope.REGION) .id(region.name()) .description(region.selfLink().toString()) .parent(provider).build(); for (URI zoneSelfLink : region.zones()) { String zoneName = toName(zoneSelfLink); zones.add(new LocationBuilder() .scope(LocationScope.ZONE) .id(zoneName) .description(zoneSelfLink.toString()) .parent(regionLocation).build()); } } return zones.build(); }