Repository: jclouds Updated Branches: refs/heads/master b64d05abb -> 415a8a660
Allows extensions to fall back on using an optional name in keystone/openstack Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/415a8a66 Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/415a8a66 Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/415a8a66 Branch: refs/heads/master Commit: 415a8a6600b517ec4a6c8fbafbc957ad4a0b74d9 Parents: b64d05a Author: Zack Shoylev <[email protected]> Authored: Wed Dec 2 16:02:43 2015 -0600 Committer: Zack Shoylev <[email protected]> Committed: Mon Dec 14 10:24:59 2015 -0600 ---------------------------------------------------------------------- .../openstack/keystone/v2_0/config/Aliases.java | 31 ---------------- .../v2_0/config/KeystoneHttpApiModule.java | 6 ++-- .../keystone/v2_0/config/NamespaceAliases.java | 31 ++++++++++++++++ ...espaceEqualsAnyNamespaceInExtensionsSet.java | 20 +++++++++-- .../v2_0/predicates/ExtensionPredicates.java | 33 ++++++++++++++--- .../openstack/v2_0/services/Extension.java | 37 +++++++++++++++----- ...ceEqualsAnyNamespaceInExtensionsSetTest.java | 35 ++++++++++++++++-- .../nova/v2_0/config/NovaHttpApiModule.java | 4 +-- .../uk/config/CloudServersUKHttpApiModule.java | 4 +-- .../us/config/CloudServersUSHttpApiModule.java | 4 +-- 10 files changed, 146 insertions(+), 59 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/Aliases.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/Aliases.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/Aliases.java deleted file mode 100644 index c589cf5..0000000 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/Aliases.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.config; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; - -@Retention(value = RetentionPolicy.RUNTIME) -@Target(value = { ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD }) -@Qualifier -public @interface Aliases { - -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/KeystoneHttpApiModule.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/KeystoneHttpApiModule.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/KeystoneHttpApiModule.java index d34541c..149edd0 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/KeystoneHttpApiModule.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/KeystoneHttpApiModule.java @@ -92,15 +92,15 @@ public class KeystoneHttpApiModule extends HttpApiModule<KeystoneApi> { } // Allow providers to cleanly contribute their own aliases - public static MapBinder<URI, URI> aliasBinder(Binder binder) { - return MapBinder.newMapBinder(binder, URI.class, URI.class, Aliases.class).permitDuplicates(); + public static MapBinder<URI, URI> namespaceAliasBinder(Binder binder) { + return MapBinder.newMapBinder(binder, URI.class, URI.class, NamespaceAliases.class).permitDuplicates(); } @Override protected void configure() { bind(ImplicitOptionalConverter.class).to(PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.class); super.configure(); - aliasBinder(binder()); + namespaceAliasBinder(binder()); } @Provides http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/NamespaceAliases.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/NamespaceAliases.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/NamespaceAliases.java new file mode 100644 index 0000000..2a9f28f --- /dev/null +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/config/NamespaceAliases.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.openstack.keystone.v2_0.config; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import javax.inject.Qualifier; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = { ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD }) +@Qualifier +public @interface NamespaceAliases { + +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java index 584b24f..101f06b 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java @@ -18,6 +18,7 @@ package org.jclouds.openstack.v2_0.functions; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Iterables.any; +import static org.jclouds.openstack.v2_0.predicates.ExtensionPredicates.nameEquals; import static org.jclouds.openstack.v2_0.predicates.ExtensionPredicates.namespaceOrAliasEquals; import static org.jclouds.util.Optionals2.unwrapIfOptional; @@ -28,7 +29,7 @@ import java.util.Set; import javax.inject.Inject; -import org.jclouds.openstack.keystone.v2_0.config.Aliases; +import org.jclouds.openstack.keystone.v2_0.config.NamespaceAliases; import org.jclouds.openstack.v2_0.domain.Extension; import org.jclouds.reflect.InvocationSuccess; import org.jclouds.rest.functions.ImplicitOptionalConverter; @@ -39,7 +40,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; /** - * We use the annotation {@link org.jclouds.openstack.services.Extension} to bind a class that implements an extension + * We use the annotation {@link Extension} to bind a class that implements an extension * API to an {@link Extension}. */ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet implements @@ -49,7 +50,7 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio @Inject PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet( - LoadingCache<String, Set<? extends Extension>> extensions, @Aliases Map<URI, Set<URI>> aliases) { + LoadingCache<String, Set<? extends Extension>> extensions, @NamespaceAliases Map<URI, Set<URI>> aliases) { this.extensions = extensions; this.aliases = aliases == null ? ImmutableMap.<URI, Set<URI>> of() : ImmutableMap.copyOf(aliases); } @@ -63,16 +64,29 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio URI namespace = URI.create(ext.get().namespace()); List<Object> args = input.getInvocation().getArgs(); Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet(); + String name = ext.get().name(); + if (args.isEmpty()) { if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliasesForNamespace))) return input.getResult(); + // Could not find extension by namespace or namespace alias. Try to find it by name next: + if ( !"".equals(name)) { + if (any(extensions.getUnchecked(""), nameEquals(name))) + return input.getResult(); + } } else if (args.size() == 1) { String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString(); if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliasesForNamespace))) return input.getResult(); + // Could not find extension by namespace or namespace alias. Try to find it by name next: + if (!"".equals(name)) { + if (any(extensions.getUnchecked(arg0), nameEquals(name))) + return input.getResult(); + } } else { throw new RuntimeException(String.format("expecting zero or one args %s", input)); } + return Optional.absent(); } else { // No extension annotation, should check whether to return absent http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/predicates/ExtensionPredicates.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/predicates/ExtensionPredicates.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/predicates/ExtensionPredicates.java index fec7d86..fdcb37c 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/predicates/ExtensionPredicates.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/predicates/ExtensionPredicates.java @@ -33,7 +33,7 @@ public class ExtensionPredicates { /** * matches namespace of the given extension - * + * * @param namespace * ex {@code http://docs.openstack.org/ext/keypairs/api/v1.1} * @return predicate that will match namespace of the given extension @@ -56,7 +56,7 @@ public class ExtensionPredicates { /** * matches alias of the given extension - * + * * @param alias * ex. {@code os-keypairs} * @return predicate that will alias of the given extension @@ -75,13 +75,13 @@ public class ExtensionPredicates { return "aliasEquals(" + alias + ")"; } }; - } + } /** * matches namespace of the given extension - * + * * @param namespace * ex {@code http://docs.openstack.org/ext/keypairs/api/v1.1} - * @param namespacesAliases + * @param namespaceAliases * Collection of ex {@code http://docs.openstack.org/compute/ext/keypairs/api/v1.1} * @return predicate that will match namespace of the given extension */ @@ -102,4 +102,27 @@ public class ExtensionPredicates { } }; } + + /** + * matches name of the given extension + * + * @param name + * ex {@code http://docs.openstack.org/ext/keypairs/api/v1.1} + * @return predicate that will match name of the given extension + */ + public static Predicate<Extension> nameEquals(final String name) { + checkNotNull(name, "extension name must be defined"); + + return new Predicate<Extension>() { + @Override + public boolean apply(Extension ext) { + return name.equals(ext.getName()); + } + + @Override + public String toString() { + return "nameEquals(" + name + ")"; + } + }; + } } http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/services/Extension.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/services/Extension.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/services/Extension.java index 8e2dbdb..f82cf46 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/services/Extension.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/services/Extension.java @@ -28,15 +28,27 @@ import javax.inject.Qualifier; * the context of the extension, we must consider the <a href= * "http://docs.openstack.org/api/openstack-compute/2/content/Extensions-d1e1444.html" * >extensions call</a>. - * + * * <br/> * For our purposes, the minimal context of an extension is the type of the * service it extends ex. {@link ServiceType#COMPUTE}, and its namespace ex. <a * href * ="http://docs.openstack.org/ext/keypairs/api/v1.1">http://docs.openstack.org * /ext/keypairs/api/v1.1</a>. - * - * + * + * <br/><br/> + * A keystone extension example:<br/><br/> + * {<br/> + * "updated": "2014-12-03T00:00:00Z",<br/> + * "name": "DiskConfig",<br/> + * "links": [<br/> + *<br/> + * ],<br/> + * "namespace": "http://docs.openstack.org/compute/ext/fake_xml",<br/> + * "alias": "OS-DCF",<br/> + * "description": "Disk Management Extension."<br/> + * },<br/> + *<br/> * @see ServiceType * @see <a href= * "http://docs.openstack.org/api/openstack-compute/2/content/Extensions-d1e1444.html" @@ -51,14 +63,14 @@ public @interface Extension { /** * the service type this is an extension of. - * + * * <h3>note</h3> - * + * * This isn't necessarily one of the built-in {@link ServiceType services}, * it could be an extension of a custom service. - * + * * @return the service type this is an extension of. - * + * */ String of(); @@ -66,9 +78,18 @@ public @interface Extension { * namespace ex. <a href * ="http://docs.openstack.org/ext/keypairs/api/v1.1">http * ://docs.openstack.org /ext/keypairs/api/v1.1</a>. - * + * * @return the namespace of the extension */ String namespace(); + /** + * @return the name of the extension + */ + String name() default ""; + + /** + * @return the alias of the extension + */ + String alias() default ""; } http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSetTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSetTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSetTest.java index 9a698a1..4b6d479 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSetTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSetTest.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Set; import org.jclouds.date.internal.SimpleDateFormatDateService; -import org.jclouds.openstack.keystone.v2_0.config.Aliases; +import org.jclouds.openstack.keystone.v2_0.config.NamespaceAliases; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.domain.Extension; import org.jclouds.reflect.Invocation; @@ -70,12 +70,20 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio } + @org.jclouds.openstack.v2_0.services.Extension(of = ServiceType.COMPUTE, name = "Floating_ips", namespace = "http://docs.openstack.org/fake") + interface FloatingIPNamedApi { + + } + interface NovaApi { @Delegate Optional<FloatingIPApi> getFloatingIPExtensionApi(String region); @Delegate + Optional<FloatingIPNamedApi> getFloatingIPNamedExtensionApi(String region); + + @Delegate Optional<KeyPairApi> getKeyPairExtensionApi(String region); } @@ -85,6 +93,11 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio Invocation.create(method(NovaApi.class, "getFloatingIPExtensionApi", String.class), args), "foo"); } + InvocationSuccess getFloatingIPNamedExtension(List<Object> args) throws SecurityException, NoSuchMethodException { + return InvocationSuccess.create( + Invocation.create(method(NovaApi.class, "getFloatingIPNamedExtensionApi", String.class), args), "foo"); + } + InvocationSuccess getKeyPairExtension(List<Object> args) throws SecurityException, NoSuchMethodException { return InvocationSuccess.create( Invocation.create(method(NovaApi.class, "getKeyPairExtensionApi", String.class), args), "foo"); @@ -108,7 +121,7 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio /** * It is possible that the /extensions call returned the correct extension, but that the * namespaces were different, for whatever reason. One way to address this is to have a multimap - * of the authoritative namespace to alternate onces, which could be wired up with guice + * of the authoritative namespace to alternate ones, which could be wired up with guice * */ public void testPresentWhenAliasForExtensionMapsToNamespace() throws SecurityException, NoSuchMethodException { @@ -125,6 +138,22 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio } + /** + * In devstack and going forward, namespaces are being deprecated. When namespace is missing (or replaced with a + * "fake" /fake namespace), allow matching by name and alias. + * + */ + public void testPresentWhenNameSpaceIsMissingAndMatchByNameOrAlias() throws SecurityException, NoSuchMethodException { + Extension floatingIpsWithFakeNamespace = floatingIps.toBuilder() + .namespace(URI.create("http://docs.openstack.org/ext/fake")) + .build(); + + Multimap<URI, URI> aliases = ImmutableMultimap.of(); + + assertEquals(whenExtensionsAndAliasesInRegionInclude("region", ImmutableSet.of(floatingIpsWithFakeNamespace), aliases).apply( + getFloatingIPNamedExtension(ImmutableList.<Object> of("region"))), Optional.of("foo")); + } + private PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet whenExtensionsInRegionInclude( String region, Extension... extensions) { return whenExtensionsAndAliasesInRegionInclude(region, ImmutableSet.copyOf(extensions), ImmutableMultimap.<URI, URI> of()); @@ -141,7 +170,7 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio @Override protected void configure() { MapBinder<URI, URI> aliasBindings = MapBinder.newMapBinder(binder(), - URI.class, URI.class, Aliases.class).permitDuplicates(); + URI.class, URI.class, NamespaceAliases.class).permitDuplicates(); for (URI key : aliases.keySet()) { for (URI value : aliases.get(key)) { aliasBindings.addBinding(key).toInstance(value); http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java index 53525d6..dcbb519 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java @@ -40,7 +40,7 @@ import java.net.URI; import java.util.Set; import java.util.concurrent.TimeUnit; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.aliasBinder; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.namespaceAliasBinder; /** * Configures the Nova connection. @@ -61,7 +61,7 @@ public class NovaHttpApiModule extends HttpApiModule<NovaApi> { // Intentionally private so subclasses use the Guice multibindings to contribute their aliases private void bindDefaultAliases() { - MapBinder<URI, URI> aliases = aliasBinder(binder()); + MapBinder<URI, URI> aliases = namespaceAliasBinder(binder()); aliases.addBinding(URI.create(ExtensionNamespaces.SECURITY_GROUPS)).toInstance( URI.create("http://docs.openstack.org/compute/ext/securitygroups/api/v1.1")); aliases.addBinding(URI.create(ExtensionNamespaces.FLOATING_IPS)).toInstance( http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/providers/rackspace-cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/uk/config/CloudServersUKHttpApiModule.java ---------------------------------------------------------------------- diff --git a/providers/rackspace-cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/uk/config/CloudServersUKHttpApiModule.java b/providers/rackspace-cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/uk/config/CloudServersUKHttpApiModule.java index adfdb32..a2d73f0 100644 --- a/providers/rackspace-cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/uk/config/CloudServersUKHttpApiModule.java +++ b/providers/rackspace-cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/uk/config/CloudServersUKHttpApiModule.java @@ -16,7 +16,7 @@ */ package org.jclouds.rackspace.cloudservers.uk.config; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.aliasBinder; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.namespaceAliasBinder; import java.net.URI; @@ -35,7 +35,7 @@ public class CloudServersUKHttpApiModule extends NovaHttpApiModule { @Override protected void configure() { super.configure(); - MapBinder<URI, URI> aliases = aliasBinder(binder()); + MapBinder<URI, URI> aliases = namespaceAliasBinder(binder()); aliases.addBinding(URI.create(ExtensionNamespaces.VOLUME_ATTACHMENTS)).toInstance( URI.create("http://docs.openstack.org/compute/ext/volumes/api/v1.1")); } http://git-wip-us.apache.org/repos/asf/jclouds/blob/415a8a66/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/config/CloudServersUSHttpApiModule.java ---------------------------------------------------------------------- diff --git a/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/config/CloudServersUSHttpApiModule.java b/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/config/CloudServersUSHttpApiModule.java index 723ccc3..23e07e9 100644 --- a/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/config/CloudServersUSHttpApiModule.java +++ b/providers/rackspace-cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/us/config/CloudServersUSHttpApiModule.java @@ -16,7 +16,7 @@ */ package org.jclouds.rackspace.cloudservers.us.config; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.aliasBinder; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.namespaceAliasBinder; import java.net.URI; @@ -36,7 +36,7 @@ public class CloudServersUSHttpApiModule extends NovaHttpApiModule { @Override protected void configure() { super.configure(); - MapBinder<URI, URI> aliases = aliasBinder(binder()); + MapBinder<URI, URI> aliases = namespaceAliasBinder(binder()); aliases.addBinding(URI.create(ExtensionNamespaces.VOLUME_ATTACHMENTS)).toInstance( URI.create("http://docs.openstack.org/compute/ext/volumes/api/v1.1")); }
