jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Turli <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] add compute functions (#346)
Date Wed, 25 Jan 2017 11:56:51 GMT
andreaturli commented on this pull request.



> +
+    private final JustProvider justProvider;
+
+    // allow us to lazy discover the provider of a resource
+    @Inject
+    FacilityToLocation(JustProvider justProvider) {
+        this.justProvider = justProvider;
+    }
+
+    @Override
+    public Location apply(final Facility facility) {
+        final LocationBuilder builder = new LocationBuilder();
+        builder.id(facility.code());
+        builder.description(facility.name());
+        builder.parent(getOnlyElement(justProvider.get()));
+        builder.scope(LocationScope.REGION);

it'd be a bit tricky as the API returns https://github.com/jclouds/jclouds-labs/blob/master/packet/src/test/resources/facilities.json
and it is not straightforward to get the correct ISO-3166 from the `name` and/or `code` I
think

-- 
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/346
Mime
View raw message