use of com.sequenceiq.cloudbreak.cloud.model.RegionsSpecification in project cloudbreak by hortonworks.
the class PlatformParameters method readRegions.
default Map<Region, List<AvailabilityZone>> readRegions(String zone) {
Map<Region, List<AvailabilityZone>> regions = new HashMap<>();
try {
RegionsSpecification oRegions = JsonUtil.readValue(zone, RegionsSpecification.class);
for (RegionSpecification regionSpecification : oRegions.getItems()) {
List<AvailabilityZone> av = new ArrayList<>();
for (String s : regionSpecification.getZones()) {
av.add(AvailabilityZone.availabilityZone(s));
}
av.sort(new StringTypesCompare());
regions.put(Region.region(regionSpecification.getName()), av);
}
} catch (IOException ignored) {
return regions;
}
return sortMap(regions);
}
Aggregations