trevorflanagan commented on this pull request.


> +import static com.google.inject.internal.util.$Preconditions.checkNotNull;
+
+@Singleton
+public class DatacenterToLocation implements Function<Datacenter, Location> {
+
+   private final JustProvider justProvider;
+
+   @Inject
+   public DatacenterToLocation(JustProvider justProvider) {
+      this.justProvider = checkNotNull(justProvider, "justProvider");
+   }
+
+   @Override
+   public Location apply(final Datacenter datacenter) {
+      return new 
LocationBuilder().id(datacenter.id()).description(datacenter.displayName())
+            
.parent(getOnlyElement(justProvider.get())).scope(LocationScope.ZONE)

@nacx we can use the same credentials for the different regions.

I see how the regions and end points are configured in aws-cloudwatch 
[here](https://github.com/trevorflanagan/jclouds/blob/8bbcfed312f6a19cd89441267f081c900b478c2c/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchProviderMetadata.java#L56).
 Is this what you are talking about?

I can see some specific region setup in EC2 
[here](https://github.com/trevorflanagan/jclouds/blob/8bbcfed312f6a19cd89441267f081c900b478c2c/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ProviderMetadata.java#L69)

Do you see these changes as something we should do for this PR or a different 
one?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/423#discussion_r158490723

Reply via email to