You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Poornima BS <po...@gmail.com> on 2017/02/07 05:54:10 UTC

EC2Api getConfiguredRegions

Hi,

Please find the below snippet of code which is used to fetch the regions,

I want to understand how is getConfiguredRegions different from
describeRegions

Both returns different set of regions getConfiguredRegions(returns 9
regions)
describeRegions(returns 14 regions)

```
EC2Api ec2 = computeServiceContext.unwrapApi(EC2Api.class);
Set<String> configuredRegions = ec2.getConfiguredRegions();
for(String s: configuredRegions){
System.out.println(s);
}
------------------------------------------------------

Optional<? extends AvailabilityZoneAndRegionApi>
availabilityZoneAndRegionApi =
ec2.getAvailabilityZoneAndRegionApi();
AvailabilityZoneAndRegionApi availabilityZoneAndRegion =
availabilityZoneAndRegionApi.get();
DescribeRegionsOptions options = new DescribeRegionsOptions();
Map<String, URI> regions =
availabilityZoneAndRegion.describeRegions(options);

````

When i use region other than configured region i get below error,

error: requested location ap-northeast-2, which is not in the configured
locations

I dont understand what is this configured region all about googled in
amazon also could not find sufficient information

Please share your thoughts on this

Thanks & Regards,
Poornima.BS