diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java index 0bf9fb2089..1604581604 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java @@ -17,8 +17,16 @@ package org.jclouds.openstack.nova.v2_0.extensions; -import com.google.common.annotations.Beta; -import com.google.common.collect.FluentIterable; +import javax.inject.Named; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + import org.jclouds.Fallbacks; import org.jclouds.javax.annotation.Nullable; import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; @@ -31,21 +39,14 @@ import org.jclouds.rest.annotations.PayloadParam; import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.SelectJson; -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import com.google.common.annotations.Beta; +import com.google.common.collect.FluentIterable; /** * Provides access to the OpenStack Compute (Nova) Attach Interfaces API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ATTACH_INTERFACES) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ATTACH_INTERFACES, name = ExtensionNames.ATTACH_INTERFACES) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/servers") @@ -53,7 +54,7 @@ public interface AttachInterfaceApi { /** * Returns list of port interfaces for given server - * + * * @param serverId * The Server ID * @return list of port interfaces for given server @@ -67,7 +68,7 @@ public interface AttachInterfaceApi { /** * Returns information about a specified port interface for given server - * + * * @param serverId * The Server ID * @param attachmentId @@ -84,7 +85,7 @@ public interface AttachInterfaceApi { /** * Creates a new port interface and associate with the given port - * + * * @param portId * The port ID * @return newly created port interface diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java index adae0a4811..f2b6478dba 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java @@ -16,8 +16,12 @@ */ package org.jclouds.openstack.nova.v2_0.extensions; -import com.google.common.annotations.Beta; -import com.google.common.collect.FluentIterable; +import javax.inject.Named; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; + import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.regionscoped.AvailabilityZone; @@ -28,17 +32,14 @@ import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.SelectJson; -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; +import com.google.common.annotations.Beta; +import com.google.common.collect.FluentIterable; /** * Provides access to the OpenStack Compute (Nova) Availability Zone Extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AVAILABILITY_ZONE) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AVAILABILITY_ZONE, name = ExtensionNames.AVAILABILITY_ZONE) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-availability-zone") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java index 715ce52473..ab54c3198c 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java @@ -44,7 +44,7 @@ import com.google.common.annotations.Beta; * */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CONSOLES) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CONSOLES, name = ExtensionNames.CONSOLES) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) public interface ConsolesApi { diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNames.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNames.java new file mode 100644 index 0000000000..f7e4227edf --- /dev/null +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNames.java @@ -0,0 +1,43 @@ +/* + * 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.nova.v2_0.extensions; + +/** + * OpenStack Nova Extension Namespaces + */ +public final class ExtensionNames { + public static final String FLOATING_IPS = "FloatingIps"; + public static final String ATTACH_INTERFACES = "AttachInterfaces"; + public static final String AVAILABILITY_ZONE = "AvailabilityZone"; + public static final String CONSOLES = "Consoles"; + public static final String FLAVOR_EXTRA_SPECS = "FlavorExtraSpecs"; + public static final String HOST_ADMINISTRATION = "Hosts"; + public static final String HOST_AGGREGATE = "Aggregates"; + public static final String HYPERVISORS = "Hypervisors"; + public static final String KEYPAIRS = "Keypairs"; + public static final String QUOTAS = "Quotas"; + public static final String SECURITY_GROUPS = "SecurityGroups"; + public static final String SERVER_ADMIN = "AdminActions"; + public static final String VIRTUAL_INTERFACES = "VirtualInterfaces"; + public static final String SIMPLE_TENANT_USAGE = "SimpleTenantUsage"; + public static final String VOLUME_ATTACHMENT = "VolumeAttachmentUpdate"; + public static final String FLOATING_IP_POOLS = "FloatingIpPools"; + + private ExtensionNames() { + throw new AssertionError("intentionally unimplemented"); + } +} diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java index 5856cd668f..abf6f4d6b3 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java @@ -53,7 +53,7 @@ import com.google.common.annotations.Beta; * @see org.jclouds.openstack.nova.v2_0.features.FlavorApi */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLAVOR_EXTRA_SPECS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLAVOR_EXTRA_SPECS, name = ExtensionNames.FLAVOR_EXTRA_SPECS) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/flavors") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java index 6160364935..67f78d7619 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java @@ -46,7 +46,7 @@ import com.google.common.collect.FluentIterable; * Provides access to the OpenStack Compute (Nova) Floating IP extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLOATING_IPS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLOATING_IPS, name = ExtensionNames.FLOATING_IPS) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) public interface FloatingIPApi { diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java index 6b3153117f..c4eaf4ab19 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java @@ -16,8 +16,11 @@ */ package org.jclouds.openstack.nova.v2_0.extensions; -import com.google.common.annotations.Beta; -import com.google.common.collect.FluentIterable; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; + import org.jclouds.Fallbacks; import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.FloatingIPPool; @@ -27,13 +30,11 @@ import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.SelectJson; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; +import com.google.common.annotations.Beta; +import com.google.common.collect.FluentIterable; @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLOATING_IP_POOLS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLOATING_IP_POOLS, name = ExtensionNames.FLOATING_IP_POOLS) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-floating-ip-pools") @RequestFilters(AuthenticateRequest.class) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java index 5836507555..bc1abd2b10 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java @@ -51,7 +51,7 @@ import com.google.common.collect.FluentIterable; * Provides access to OpenStack Compute (Nova) Host Administration extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.HOSTS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.HOSTS, name = ExtensionNames.HOST_ADMINISTRATION) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-hosts") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java index b291ca011f..9e2cc7974a 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java @@ -49,7 +49,7 @@ import com.google.common.collect.FluentIterable; * Provide access to the OpenStack Compute (Nova) Host Aggregates extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AGGREGATES) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AGGREGATES, name = ExtensionNames.HOST_AGGREGATE) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-aggregates") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java index 17feddaa6d..a882f7edab 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java @@ -16,8 +16,12 @@ */ package org.jclouds.openstack.nova.v2_0.extensions; -import com.google.common.annotations.Beta; -import com.google.common.collect.FluentIterable; +import javax.inject.Named; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.core.MediaType; + import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.regionscoped.Hypervisor; @@ -28,17 +32,14 @@ import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.SelectJson; -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; +import com.google.common.annotations.Beta; +import com.google.common.collect.FluentIterable; /** * Provides access to the OpenStack Compute (Nova) Hypervisor Extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.HYPERVISORS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.HYPERVISORS, name = ExtensionNames.HYPERVISORS) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-hypervisors") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java index cdc1d17f54..d8065451c5 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java @@ -51,7 +51,7 @@ import com.google.common.collect.FluentIterable; * Provides access to the OpenStack Compute (Nova) Key Pair Extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.KEYPAIRS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.KEYPAIRS, name = ExtensionNames.KEYPAIRS) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-keypairs") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java index ce7aeb84ec..a8e2027af7 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java @@ -51,7 +51,7 @@ import com.google.common.annotations.Beta; * */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.QUOTAS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.QUOTAS, name = ExtensionNames.QUOTAS) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-quota-sets") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java index ec37d65005..44afc367eb 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java @@ -51,7 +51,7 @@ import com.google.common.collect.FluentIterable; * Provides access to the OpenStack Compute (Nova) Security Group extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SECURITY_GROUPS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SECURITY_GROUPS, name = ExtensionNames.SECURITY_GROUPS) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) public interface SecurityGroupApi { diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java index bf22f407f1..053feebfc1 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java @@ -50,7 +50,7 @@ import com.google.common.annotations.Beta; * */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ADMIN_ACTIONS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ADMIN_ACTIONS, name = ExtensionNames.SERVER_ADMIN) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/servers/{id}/action") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java index 46dff34c5f..6e74d17266 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java @@ -41,7 +41,7 @@ import com.google.common.collect.FluentIterable; * Provides access to the OpenStack Compute (Nova) Simple Tenant Usage extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SIMPLE_TENANT_USAGE) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SIMPLE_TENANT_USAGE, name = ExtensionNames.SIMPLE_TENANT_USAGE) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/os-simple-tenant-usage") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java index a0f8833a91..8f6f147ba8 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java @@ -39,7 +39,7 @@ import com.google.common.collect.FluentIterable; * Provides access to the OpenStack Compute (Nova) Virtual Interface (VIFs) extension API. */ @Beta -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VIRTUAL_INTERFACES) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VIRTUAL_INTERFACES, name = ExtensionNames.VIRTUAL_INTERFACES) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/servers") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java index f274651e1b..7fbe8ae3a3 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java @@ -48,7 +48,7 @@ import com.google.common.collect.FluentIterable; * This API strictly handles attaching Volumes to Servers. To create and manage Volumes you need to use the Cinder API. * @see org.jclouds.openstack.cinder.v1.features.VolumeApi */ -@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VOLUME_ATTACHMENTS) +@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VOLUME_ATTACHMENTS, name = ExtensionNames.VOLUME_ATTACHMENT) @RequestFilters(AuthenticateRequest.class) @Consumes(MediaType.APPLICATION_JSON) @Path("/servers") diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApiExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApiExpectTest.java index e77c2e2d11..7bec68ead9 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApiExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApiExpectTest.java @@ -58,6 +58,17 @@ public class FloatingIPApiExpectTest extends BaseNovaApiExpectTest { } + public void testNamespaceMissingNameFallback() throws Exception { + + NovaApi apiWhenExtensionNotInList = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName, + responseWithKeystoneAccess, extensionsOfNovaRequest, unmatchedExtensionsOfNovaResponseWithNoNamespace); + + assertEquals(apiWhenExtensionNotInList.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1")); + + assertTrue(apiWhenExtensionNotInList.getFloatingIPApi("az-1.region-a.geo-1").isPresent()); + + } + public void testListFloatingIPsWhenResponseIs2xx() throws Exception { HttpRequest list = HttpRequest .builder() diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaExpectTest.java index 76460bcc09..e4dc191226 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaExpectTest.java @@ -35,6 +35,7 @@ public class BaseNovaExpectTest extends BaseRestApiExpectTest { protected HttpRequest extensionsOfNovaRequest; protected HttpResponse extensionsOfNovaResponse; protected HttpResponse unmatchedExtensionsOfNovaResponse; + protected HttpResponse unmatchedExtensionsOfNovaResponseWithNoNamespace; protected HttpRequest keystoneAuthWithAccessKeyAndSecretKeyAndTenantId; protected String identityWithTenantId; @@ -48,13 +49,13 @@ public class BaseNovaExpectTest extends BaseRestApiExpectTest { credential); keystoneAuthWithAccessKeyAndSecretKeyAndTenantId = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantId(identity, credential); - + authToken = KeystoneFixture.INSTANCE.getAuthToken(); responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess(); // now, createContext arg will need tenant prefix identityWithTenantId = KeystoneFixture.INSTANCE.getTenantId() + ":" + identity; identity = KeystoneFixture.INSTANCE.getTenantName() + ":" + identity; - + extensionsOfNovaRequest = HttpRequest.builder().method("GET") // NOTE THIS IS NOVA, NOT KEYSTONE .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/extensions") @@ -63,16 +64,19 @@ public class BaseNovaExpectTest extends BaseRestApiExpectTest { extensionsOfNovaResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResource("/extension_list_full.json")).build(); - + unmatchedExtensionsOfNovaResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResource("/extension_list.json")).build(); + + unmatchedExtensionsOfNovaResponseWithNoNamespace = HttpResponse.builder().statusCode(200) + .payload(payloadFromResource("/extension_list_full_no_namespaces.json")).build(); } @Override protected HttpRequestComparisonType compareHttpRequestAsType(HttpRequest input) { return HttpRequestComparisonType.JSON; } - + protected HttpRequest.Builder authenticatedGET() { return HttpRequest.builder() .method("GET") diff --git a/apis/openstack-nova/src/test/resources/extension_list_full_no_namespaces.json b/apis/openstack-nova/src/test/resources/extension_list_full_no_namespaces.json new file mode 100644 index 0000000000..788c17ef4f --- /dev/null +++ b/apis/openstack-nova/src/test/resources/extension_list_full_no_namespaces.json @@ -0,0 +1,316 @@ +{ + "extensions": [ + { + "updated": "2011-09-27T00:00:00+00:00", + "name": "DiskConfig", + "links": [], + "namespace": "http://fake.org", + "alias": "OS-DCF", + "description": "Disk Management Extension" + }, + { + "updated": "2011-06-29T00:00:00+00:00", + "name": "Hosts", + "links": [], + "namespace": "http://fake.org", + "alias": "os-hosts", + "description": "Admin-only host administration" + }, + { + "updated": "2011-07-19T00:00:00+00:00", + "name": "SchedulerHints", + "links": [], + "namespace": "http://fake.org", + "alias": "os-scheduler-hints", + "description": "Pass arbitrary key/value pairs to the scheduler" + }, + { + "updated": "2011-08-08T00:00:00+00:00", + "name": "Quotas", + "links": [], + "namespace": "http://fake.org", + "alias": "os-quota-sets", + "description": "Quotas management support" + }, + { + "updated": "2011-12-23T00:00:00+00:00", + "name": "Floating_ip_dns", + "links": [], + "namespace": "http://fake.org", + "alias": "os-floating-ip-dns", + "description": "Floating IP DNS support" + }, + { + "updated": "2011-09-14T00:00:00+00:00", + "name": "FlavorExtraData", + "links": [], + "namespace": "http://fake.org", + "alias": "OS-FLV-EXT-DATA", + "description": "Provide additional data for flavors" + }, + { + "updated": "2011-06-23T00:00:00+00:00", + "name": "FlavorExtraSpecs", + "links": [], + "namespace": "http://fake.org", + "alias": "os-flavor-extra-specs", + "description": "Instance type (flavor) extra specs" + }, + { + "updated": "2011-08-17T00:00:00+00:00", + "name": "VirtualInterfaces", + "links": [], + "namespace": "http://fake.org", + "alias": "virtual_interfaces", + "description": "Virtual interface support" + }, + { + "updated": "2011-12-23T00:00:00+00:00", + "name": "Accounts", + "links": [], + "namespace": "http://fake.org", + "alias": "os-accounts", + "description": "Admin-only access to accounts" + }, + { + "updated": "2011-03-25T00:00:00+00:00", + "name": "Volumes", + "links": [], + "namespace": "http://fake.org", + "alias": "os-volumes", + "description": "Volumes support" + }, + { + "updated": "2011-11-03T00:00:00+00:00", + "name": "ExtendedStatus", + "links": [], + "namespace": "http://fake.org", + "alias": "OS-EXT-STS", + "description": "Extended Status support" + }, + { + "updated": "2011-12-23T00:00:00+00:00", + "name": "Consoles", + "links": [], + "namespace": "http://fake.org", + "alias": "os-consoles", + "description": "Interactive Console support." + }, + { + "updated": "2011-07-21T00:00:00+00:00", + "name": "SecurityGroups", + "links": [], + "namespace": "http://fake.org", + "alias": "security_groups", + "description": "Security group support" + }, + { + "updated": "2012-01-12T00:00:00+00:00", + "name": "Aggregates", + "links": [], + "namespace": "http://fake.org", + "alias": "os-aggregates", + "description": "Admin-only aggregate administration" + }, + { + "updated": "2011-07-19T00:00:00+00:00", + "name": "Createserverext", + "links": [], + "namespace": "http://fake.org", + "alias": "os-create-server-ext", + "description": "Extended support to the Create Server v1.1 API" + }, + { + "updated": "2011-09-01T00:00:00+00:00", + "name": "DeferredDelete", + "links": [], + "namespace": "http://fake.org", + "alias": "os-deferred-delete", + "description": "Instance deferred delete" + }, + { + "updated": "2011-12-21T00:00:00+00:00", + "name": "ServerDiagnostics", + "links": [], + "namespace": "http://fake.org", + "alias": "os-server-diagnostics", + "description": "Allow Admins to view server diagnostics through server action" + }, + { + "updated": "2011-12-23T00:00:00+00:00", + "name": "Networks", + "links": [], + "namespace": "http://fake.org", + "alias": "os-networks", + "description": "Admin-only Network Management Extension" + }, + { + "updated": "2011-11-03T00:00:00+00:00", + "name": "ExtendedServerAttributes", + "links": [], + "namespace": "http://fake.org", + "alias": "OS-EXT-SRV-ATTR", + "description": "Extended Server Attributes support." + }, + { + "updated": "2011-08-08T00:00:00+00:00", + "name": "Keypairs", + "links": [], + "namespace": "http://fake.org", + "alias": "os-keypairs", + "description": "Keypair Support" + }, + { + "updated": "2011-08-24T00:00:00+00:00", + "name": "VolumeTypes", + "links": [], + "namespace": "http://fake.org", + "alias": "os-volume-types", + "description": "Volume types support" + }, + { + "updated": "2011-08-19T00:00:00+00:00", + "name": "SimpleTenantUsage", + "links": [], + "namespace": "http://fake.org", + "alias": "os-simple-tenant-usage", + "description": "Simple tenant usage extension" + }, + { + "updated": "2012-01-04T00:00:00+00:00", + "name": "Floating_ip_pools", + "links": [], + "namespace": "http://fake.org", + "alias": "os-floating-ip-pools", + "description": "Floating IPs support" + }, + { + "updated": "2012-01-23T00:00:00+00:00", + "name": "ServerStartStop", + "links": [], + "namespace": "http://fake.org", + "alias": "os-server-start-stop", + "description": "Start/Stop instance compute API support" + }, + { + "updated": "2012-01-19T00:00:00+00:00", + "name": "Certificates", + "links": [], + "namespace": "http://fake.org", + "alias": "os-certificates", + "description": "Certificates support" + }, + { + "updated": "2011-08-18T00:00:00+00:00", + "name": "Rescue", + "links": [], + "namespace": "http://fake.org", + "alias": "os-rescue", + "description": "Instance rescue mode" + }, + { + "updated": "2012-01-19T00:00:00+00:00", + "name": "FlavorManage", + "links": [], + "namespace": "http://fake.org", + "alias": "os-flavor-manage", + "description": "\n Flavor create/delete API support\n " + }, + { + "updated": "2011-12-16T00:00:00+00:00", + "name": "Cloudpipe", + "links": [], + "namespace": "http://fake.org", + "alias": "os-cloudpipe", + "description": "Adds actions to create cloudpipe instances.\n\n When running with the Vlan network mode, you need a mechanism to route\n from the public Internet to your vlans. This mechanism is known as a\n cloudpipe.\n\n At the time of creating this class, only OpenVPN is supported. Support for\n a SSH Bastion host is forthcoming.\n " + }, + { + "updated": "2011-06-09T00:00:00+00:00", + "name": "Multinic", + "links": [], + "namespace": "http://fake.org", + "alias": "NMN", + "description": "Multiple network support" + }, + { + "updated": "2011-08-08T00:00:00+00:00", + "name": "Users", + "links": [], + "namespace": "http://fake.org", + "alias": "os-users", + "description": "Allow admins to acces user information" + }, + { + "updated": "2011-09-20T00:00:00+00:00", + "name": "AdminActions", + "links": [], + "namespace": "http://fake.org", + "alias": "os-admin-actions", + "description": "Enable admin-only server actions\n\n Actions include: pause,unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n " + }, + { + "updated": "2011-12-21T00:00:00+00:00", + "name": "ServerActionList", + "links": [], + "namespace": "http://fake.org", + "alias": "os-server-action-list", + "description": "Allow Admins to view pending server actions" + }, + { + "updated": "2011-12-08T00:00:00+00:00", + "name": "Console_output", + "links": [], + "namespace": "http://fake.org", + "alias": "os-console-output", + "description": "Console log output support, with tailing ability." + }, + { + "updated": "2011-06-16T00:00:00+00:00", + "name": "FloatingIps", + "links": [], + "namespace": "http://fake.org", + "alias": "os-floating-ips", + "description": "Floating IPs support" + }, + { + "updated": "2012-12-21T00:00:00+00:00", + "name": "AvailabilityZone", + "links": [], + "namespace": "http://fake.org", + "alias": "os-availability-zone", + "description": "1. Add availability_zone to the Create Server v1.1 API.\n 2. Add availability zones describing.\n " + }, + { + "updated": "2013-07-08T00:00:00+00:00", + "name": "BlockDeviceMappingV2Boot", + "links": [], + "namespace": "http://fake.org", + "alias": "os-block-device-mapping-v2-boot", + "description": "Allow boot with the new BDM data format." + }, + { + "alias": "os-volume-attachment-update", + "description": "Support for updating a volume attachment.", + "links": [], + "name": "VolumeAttachmentUpdate", + "namespace": "http://fake.org", + "updated": "2013-06-20T00:00:00Z" + }, + { + "updated": "2012-07-22T00:00:00Z", + "name": "AttachInterfaces", + "links": [], + "namespace": "http://fake.org", + "alias": "os-attach-interfaces", + "description": "Attach interface support." + }, + { + "updated": "2012-06-21T00:00:00Z", + "name": "Hypervisors", + "links": [], + "namespace": "http://fake.org", + "alias": "os-hypervisors", + "description": "Admin-only hypervisor administration." + } + ] +}