diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionApi.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionApi.java
index 330b439ee0..e2c5fb6600 100644
--- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionApi.java
+++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionApi.java
@@ -17,25 +17,40 @@
package org.jclouds.openstack.v2_0.features;
import java.util.Set;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
import org.jclouds.openstack.v2_0.domain.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
/**
* Provides asynchronous access to Extensions via their REST API.
- *
- *
- * @see ExtensionAsyncApi
- * @see
*/
+@RequestFilters(AuthenticateRequest.class)
public interface ExtensionApi {
/**
- * List all available extensions
+ * Lists all available extensions
*
* @return all extensions
*/
- Set extends Extension> list();
+ @Named("extension:list")
+ @GET
+ @SelectJson("extensions")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Path("/extensions")
+ @Fallback(EmptySetOnNotFoundOr404.class)
+ Set list();
/**
* Extensions may also be queried individually by their unique alias.
@@ -44,6 +59,11 @@ public interface ExtensionApi {
* id of the extension
* @return extension or null if not found
*/
- Extension get(String alias);
-
+ @Named("extension:get")
+ @GET
+ @SelectJson("extension")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Path("/extensions/{alias}")
+ @Fallback(NullOnNotFoundOr404.class)
+ Extension get(@PathParam("alias") String id);
}
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
index aaa18c20db..9f8d30203b 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
@@ -18,6 +18,7 @@ package org.jclouds.openstack.nova.v2_0;
import java.io.Closeable;
import java.util.Set;
+
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.location.Zone;
import org.jclouds.location.functions.ZoneToEndpoint;
@@ -48,12 +49,9 @@ import com.google.common.base.Optional;
import com.google.inject.Provides;
/**
- * Provides synchronous access to Nova.
+ * Provides access to the OpenStack Compute (Nova) API.
*
*
- * @see NovaAsyncApi
- * @see
*/
public interface NovaApi extends Closeable {
/**
@@ -65,133 +63,133 @@ public interface NovaApi extends Closeable {
Set getConfiguredZones();
/**
- * Provides synchronous access to availability zone features
- */
- @Delegate
- Optional extends AvailabilityZoneApi> getAvailabilityZoneApi(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides synchronous access to Server features.
+ * Provides access to Server features.
*/
@Delegate
ServerApi getServerApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Flavor features.
+ * Provides access to Flavor features.
*/
@Delegate
FlavorApi getFlavorApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Extension features.
+ * Provides access to Extension features.
*/
@Delegate
ExtensionApi getExtensionApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Image features.
+ * Provides access to Image features.
*/
@Delegate
ImageApi getImageApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Floating IP features.
+ * Provides access to availability zone features
+ */
+ @Delegate
+ Optional extends AvailabilityZoneApi> getAvailabilityZoneApi(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides access to Floating IP features.
*/
@Delegate
Optional extends FloatingIPApi> getFloatingIPExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Security Group features.
+ * Provides access to Security Group features.
*/
@Delegate
Optional extends SecurityGroupApi> getSecurityGroupExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Key Pair features.
+ * Provides access to Key Pair features.
*/
@Delegate
Optional extends KeyPairApi> getKeyPairExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Host Administration features.
+ * Provides access to Host Administration features.
*/
@Delegate
Optional extends HostAdministrationApi> getHostAdministrationExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Simple Tenant Usage features.
+ * Provides access to Simple Tenant Usage features.
*/
@Delegate
Optional extends SimpleTenantUsageApi> getSimpleTenantUsageExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Virtual Interface features.
+ * Provides access to Virtual Interface features.
*/
@Delegate
Optional extends VirtualInterfaceApi> getVirtualInterfaceExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Server Extra Data features.
+ * Provides access to Server Extra Data features.
*/
@Delegate
Optional extends ServerWithSecurityGroupsApi> getServerWithSecurityGroupsExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Server Admin Actions features.
+ * Provides access to Server Admin Actions features.
*/
@Delegate
Optional extends ServerAdminApi> getServerAdminExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Aggregate features.
+ * Provides access to Aggregate features.
*/
@Delegate
Optional extends HostAggregateApi> getHostAggregateExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Flavor extra specs features.
+ * Provides access to Flavor extra specs features.
*/
@Delegate
Optional extends FlavorExtraSpecsApi> getFlavorExtraSpecsExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Quota features.
+ * Provides access to Quota features.
*/
@Delegate
Optional extends QuotaApi> getQuotaExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Volume features.
+ * Provides access to Volume features.
*/
@Delegate
Optional extends VolumeApi> getVolumeExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Volume Attachment features.
+ * Provides access to Volume Attachment features.
*/
@Delegate
Optional extends VolumeAttachmentApi> getVolumeAttachmentExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Volume Type features.
+ * Provides access to Volume Type features.
*/
@Delegate
Optional extends VolumeTypeApi> getVolumeTypeExtensionForZone(
@@ -203,5 +201,4 @@ public interface NovaApi extends Closeable {
@Delegate
Optional extends ConsolesApi> getConsolesExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
}
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java
index d157546a0f..2958c4e4d5 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java
@@ -28,33 +28,23 @@ import java.net.URI;
import java.util.Properties;
import org.jclouds.compute.ComputeServiceContext;
+import org.jclouds.openstack.keystone.v2_0.config.AuthenticationApiModule;
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
-import org.jclouds.openstack.keystone.v2_0.config.MappedAuthenticationApiModule;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule;
import org.jclouds.openstack.nova.v2_0.compute.config.NovaComputeServiceContextModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaHttpApiModule;
import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
-import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule;
import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.rest.internal.BaseRestApiMetadata;
+import org.jclouds.rest.internal.BaseHttpApiMetadata;
import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
import com.google.inject.Module;
/**
- * Implementation of {@link ApiMetadata} for Nova 2.0 API
+ * Implementation of {@link org.jclouds.apis.ApiMetadata} for Nova 2.0 API
*/
-public class NovaApiMetadata extends BaseRestApiMetadata {
-
- /**
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaApi.class)} as
- * {@link NovaAsyncApi} interface will be removed in jclouds 1.7.
- */
- @Deprecated
- public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() {
- private static final long serialVersionUID = 1L;
- };
+public class NovaApiMetadata extends BaseHttpApiMetadata {
@Override
public Builder toBuilder() {
@@ -70,7 +60,7 @@ public class NovaApiMetadata extends BaseRestApiMetadata {
}
public static Properties defaultProperties() {
- Properties properties = BaseRestApiMetadata.defaultProperties();
+ Properties properties = BaseHttpApiMetadata.defaultProperties();
// auth fail can happen while cloud-init applies keypair updates
properties.setProperty("jclouds.ssh.max-retries", "7");
properties.setProperty("jclouds.ssh.retry-auth", "true");
@@ -86,30 +76,28 @@ public class NovaApiMetadata extends BaseRestApiMetadata {
return properties;
}
- public static class Builder extends BaseRestApiMetadata.Builder {
+ public static class Builder extends BaseHttpApiMetadata.Builder {
- @SuppressWarnings("deprecation")
protected Builder() {
- super(NovaApi.class, NovaAsyncApi.class);
id("openstack-nova")
.name("OpenStack Nova Diablo+ API")
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
.credentialName("${password}")
- .endpointName("KeyStone base url ending in /v2.0/")
+ .endpointName("Keystone base url ending in /v2.0/")
.documentation(URI.create("http://api.openstack.org/"))
.version("1.1")
.defaultEndpoint("http://localhost:5000/v2.0/")
.defaultProperties(NovaApiMetadata.defaultProperties())
.view(typeToken(ComputeServiceContext.class))
.defaultModules(ImmutableSet.>builder()
- .add(MappedAuthenticationApiModule.class)
+ .add(AuthenticationApiModule.class)
.add(KeystoneAuthenticationModule.class)
.add(ZoneModule.class)
.add(NovaParserModule.class)
- .add(NovaRestClientModule.class)
+ .add(NovaHttpApiModule.class)
.add(NovaComputeServiceContextModule.class).build());
}
-
+
@Override
public NovaApiMetadata build() {
return new NovaApiMetadata(this);
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java
deleted file mode 100644
index 2ac99592c1..0000000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java
+++ /dev/null
@@ -1,213 +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.nova.v2_0;
-
-import java.io.Closeable;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Zone;
-import org.jclouds.location.functions.ZoneToEndpoint;
-import org.jclouds.openstack.nova.v2_0.extensions.AvailabilityZoneAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ConsolesAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.FloatingIPAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.HostAdministrationAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.HostAggregateAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.KeyPairAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.QuotaAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ServerAdminAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ServerWithSecurityGroupsAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.SimpleTenantUsageAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VirtualInterfaceAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeAttachmentAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeAsyncApi;
-import org.jclouds.openstack.nova.v2_0.features.FlavorAsyncApi;
-import org.jclouds.openstack.nova.v2_0.features.ImageAsyncApi;
-import org.jclouds.openstack.nova.v2_0.features.ServerAsyncApi;
-import org.jclouds.openstack.v2_0.features.ExtensionAsyncApi;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-
-import com.google.common.base.Optional;
-import com.google.inject.Provides;
-
-/**
- * Provides asynchronous access to Nova via their REST API.
- *
- *
- * @see NovaApi
- * @see
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaApi.class)} as
- * {@link NovaAsyncApi} interface will be removed in jclouds 1.7.
- */
-@Deprecated
-public interface NovaAsyncApi extends Closeable {
-
- /**
- *
- * @return the Zone codes configured
- */
- @Provides
- @Zone
- Set getConfiguredZones();
-
- /**
- * Provides asynchronous access to availability zone features
- */
- @Delegate
- Optional extends AvailabilityZoneAsyncApi> getAvailabilityZoneApi(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Server features.
- */
- @Delegate
- ServerAsyncApi getServerApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Flavor features.
- */
- @Delegate
- FlavorAsyncApi getFlavorApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Extension features.
- */
- @Delegate
- ExtensionAsyncApi getExtensionApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Image features.
- */
- @Delegate
- ImageAsyncApi getImageApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Floating IP features.
- */
- @Delegate
- Optional extends FloatingIPAsyncApi> getFloatingIPExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Security Group features.
- */
- @Delegate
- Optional extends SecurityGroupAsyncApi> getSecurityGroupExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Key Pair features.
- */
- @Delegate
- Optional extends KeyPairAsyncApi> getKeyPairExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Host Administration features.
- */
- @Delegate
- Optional extends HostAdministrationAsyncApi> getHostAdministrationExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Simple Tenant Usage features.
- */
- @Delegate
- Optional extends SimpleTenantUsageAsyncApi> getSimpleTenantUsageExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Virtual Interface features.
- */
- @Delegate
- Optional extends VirtualInterfaceAsyncApi> getVirtualInterfaceExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
-
- /**
- * Provides asynchronous access to Server Extra Data features.
- */
- @Delegate
- Optional extends ServerWithSecurityGroupsAsyncApi> getServerWithSecurityGroupsExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Server Admin Actions features.
- */
- @Delegate
- Optional extends ServerAdminAsyncApi> getServerAdminExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to HostAggregate features.
- */
- @Delegate
- Optional extends HostAggregateAsyncApi> getHostAggregateExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Flavor extra specs features.
- */
- @Delegate
- Optional extends FlavorExtraSpecsAsyncApi> getFlavorExtraSpecsExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Quota features.
- */
- @Delegate
- Optional extends QuotaAsyncApi> getQuotaExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Volume features.
- */
- @Delegate
- Optional extends VolumeAsyncApi> getVolumeExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Volume features.
- */
- @Delegate
- Optional extends VolumeAttachmentAsyncApi> getVolumeAttachmentExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Volume Type features.
- */
- @Delegate
- Optional extends VolumeTypeAsyncApi> getVolumeTypeExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides asynchronous access to Volume Type features.
- */
- @Delegate
- Optional extends ConsolesAsyncApi> getConsolesExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
-}
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
index 8783f84def..c068c6c726 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
@@ -86,7 +86,7 @@ public class NovaComputeServiceAdapter implements
this.zoneIds = checkNotNull(zoneIds, "zoneIds");
this.removeFloatingIpFromNodeAndDeallocate = checkNotNull(removeFloatingIpFromNodeAndDeallocate,
"removeFloatingIpFromNodeAndDeallocate");
- this.keyPairCache = checkNotNull(keyPairCache, "keyPairCache");
+ this.keyPairCache = checkNotNull(keyPairCache, "keyPairCache");
}
/**
@@ -117,7 +117,7 @@ public class NovaComputeServiceAdapter implements
Optional privateKey = Optional.absent();
if (templateOptions.getKeyPairName() != null) {
- options.keyPairName(templateOptions.getKeyPairName());
+ options.keyPairName(templateOptions.getKeyPairName());
KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName()));
if (keyPair != null && keyPair.getPrivateKey() != null) {
privateKey = Optional.of(keyPair.getPrivateKey());
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
similarity index 51%
rename from apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java
rename to apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
index 799cf15236..d763406bdc 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
@@ -15,10 +15,8 @@
* limitations under the License.
*/
package org.jclouds.openstack.nova.v2_0.config;
-import static org.jclouds.reflect.Reflection2.typeToken;
import java.net.URI;
-import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
@@ -30,101 +28,30 @@ import org.jclouds.http.annotation.ClientError;
import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.NovaAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.AvailabilityZoneApi;
-import org.jclouds.openstack.nova.v2_0.extensions.AvailabilityZoneAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ConsolesApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ConsolesAsyncApi;
import org.jclouds.openstack.nova.v2_0.extensions.ExtensionNamespaces;
-import org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsApi;
-import org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.FloatingIPApi;
-import org.jclouds.openstack.nova.v2_0.extensions.FloatingIPAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.HostAdministrationApi;
-import org.jclouds.openstack.nova.v2_0.extensions.HostAdministrationAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.HostAggregateApi;
-import org.jclouds.openstack.nova.v2_0.extensions.HostAggregateAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.KeyPairApi;
-import org.jclouds.openstack.nova.v2_0.extensions.KeyPairAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.QuotaApi;
-import org.jclouds.openstack.nova.v2_0.extensions.QuotaAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
-import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ServerAdminApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ServerAdminAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ServerWithSecurityGroupsApi;
-import org.jclouds.openstack.nova.v2_0.extensions.ServerWithSecurityGroupsAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.SimpleTenantUsageApi;
-import org.jclouds.openstack.nova.v2_0.extensions.SimpleTenantUsageAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VirtualInterfaceApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VirtualInterfaceAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeAttachmentApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeAttachmentAsyncApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeApi;
-import org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeAsyncApi;
-import org.jclouds.openstack.nova.v2_0.features.FlavorApi;
-import org.jclouds.openstack.nova.v2_0.features.FlavorAsyncApi;
-import org.jclouds.openstack.nova.v2_0.features.ImageApi;
-import org.jclouds.openstack.nova.v2_0.features.ImageAsyncApi;
-import org.jclouds.openstack.nova.v2_0.features.ServerApi;
-import org.jclouds.openstack.nova.v2_0.features.ServerAsyncApi;
import org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler;
import org.jclouds.openstack.v2_0.domain.Extension;
-import org.jclouds.openstack.v2_0.features.ExtensionApi;
-import org.jclouds.openstack.v2_0.features.ExtensionAsyncApi;
import org.jclouds.openstack.v2_0.functions.PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet;
import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.config.RestClientModule;
+import org.jclouds.rest.config.HttpApiModule;
import org.jclouds.rest.functions.ImplicitOptionalConverter;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
-import com.google.common.reflect.TypeToken;
import com.google.inject.Provides;
/**
* Configures the Nova connection.
+ *
*/
@ConfiguresRestClient
-public class NovaRestClientModule extends RestClientModule {
- public static final Map, Class>> DELEGATE_MAP = ImmutableMap., Class>> builder()
- .put(ServerApi.class, ServerAsyncApi.class)
- .put(FlavorApi.class, FlavorAsyncApi.class)
- .put(ImageApi.class, ImageAsyncApi.class)
- .put(ExtensionApi.class, ExtensionAsyncApi.class)
- .put(FloatingIPApi.class, FloatingIPAsyncApi.class)
- .put(AvailabilityZoneApi.class, AvailabilityZoneAsyncApi.class)
- .put(SecurityGroupApi.class, SecurityGroupAsyncApi.class)
- .put(KeyPairApi.class, KeyPairAsyncApi.class)
- .put(HostAdministrationApi.class, HostAdministrationAsyncApi.class)
- .put(SimpleTenantUsageApi.class, SimpleTenantUsageAsyncApi.class)
- .put(VirtualInterfaceApi.class, VirtualInterfaceAsyncApi.class)
- .put(ServerWithSecurityGroupsApi.class, ServerWithSecurityGroupsAsyncApi.class)
- .put(ServerAdminApi.class, ServerAdminAsyncApi.class)
- .put(HostAggregateApi.class, HostAggregateAsyncApi.class)
- .put(FlavorExtraSpecsApi.class, FlavorExtraSpecsAsyncApi.class)
- .put(QuotaApi.class, QuotaAsyncApi.class)
- .put(VolumeApi.class, VolumeAsyncApi.class)
- .put(VolumeAttachmentApi.class, VolumeAttachmentAsyncApi.class)
- .put(VolumeTypeApi.class, VolumeTypeAsyncApi.class)
- .put(ConsolesApi.class, ConsolesAsyncApi.class)
- .build();
+public class NovaHttpApiModule extends HttpApiModule {
- @SuppressWarnings("unchecked")
- public NovaRestClientModule() {
- super(TypeToken.class.cast(typeToken(NovaApi.class)), TypeToken.class.cast(typeToken(NovaAsyncApi.class)), DELEGATE_MAP);
- }
-
- protected NovaRestClientModule(TypeToken syncClientType, TypeToken asyncClientType,
- Map, Class>> sync2Async) {
- super(syncClientType, asyncClientType, sync2Async);
+ public NovaHttpApiModule() {
}
@Override
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 edcd7d5d87..7b894fb115 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,19 +16,39 @@
*/
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.zonescoped.AvailabilityZone;
import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.openstack.v2_0.services.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+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)
+@RequestFilters(AuthenticateRequest.class)
+@Consumes(MediaType.APPLICATION_JSON)
+@Path("/os-availability-zone")
public interface AvailabilityZoneApi {
-
/**
* @return all availability zones
*/
- FluentIterable extends AvailabilityZone> list();
-
+ @Named("availabilityZone:list")
+ @GET
+ @SelectJson("availabilityZoneInfo")
+ @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
+ FluentIterable list();
}
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java
deleted file mode 100644
index bf86b743ea..0000000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneAsyncApi.java
+++ /dev/null
@@ -1,52 +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.nova.v2_0.extensions;
-
-import com.google.common.annotations.Beta;
-import com.google.common.collect.FluentIterable;
-import com.google.common.util.concurrent.ListenableFuture;
-import org.jclouds.Fallbacks;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.zonescoped.AvailabilityZone;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.openstack.v2_0.services.Extension;
-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;
-
-
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.AVAILABILITY_ZONE)
-@RequestFilters(AuthenticateRequest.class)
-public interface AvailabilityZoneAsyncApi {
-
- /**
- * @return all availability zones
- */
- @GET
- @Path("/os-availability-zone")
- @SelectJson("availabilityZoneInfo")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(Fallbacks.EmptyFluentIterableOnNotFoundOr404.class)
- ListenableFuture extends FluentIterable extends AvailabilityZone>> list();
-
-}
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 5f3c848a99..715ce52473 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
@@ -16,26 +16,51 @@
*/
package org.jclouds.openstack.nova.v2_0.extensions;
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+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.MapHttp4xxCodesToExceptions;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.openstack.nova.v2_0.binders.BindConsoleToJsonPayload;
import org.jclouds.openstack.nova.v2_0.domain.Console;
import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.openstack.v2_0.services.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
import com.google.common.annotations.Beta;
/**
- * Provides synchronous access to Consoles.
+ * Provides access to the OpenStack Compute (Nova) Consoles Extension API.
*
*
- * @see ConsoleAsyncApi
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CONSOLES)
+@RequestFilters(AuthenticateRequest.class)
+@Consumes(MediaType.APPLICATION_JSON)
public interface ConsolesApi {
/**
- * Get the Console
+ * Gets the specified server Console.
+ *
* @param serverId Server id
* @param type see {@link Console.Type}
* @return a Console object containing the console url and type.
*/
- Console getConsole(String serverId, Console.Type type);
+ @Named("consoles:getConsole")
+ @POST
+ @Path("/servers/{serverId}/action")
+ @SelectJson("console")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Fallback(MapHttp4xxCodesToExceptions.class)
+ @MapBinder(BindConsoleToJsonPayload.class)
+ Console getConsole(@PathParam("serverId") String serverId, @PayloadParam("type") Console.Type type);
}
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesAsyncApi.java
deleted file mode 100644
index 97f2af74c9..0000000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesAsyncApi.java
+++ /dev/null
@@ -1,68 +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.nova.v2_0.extensions;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-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.MapHttp4xxCodesToExceptions;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.Console;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.openstack.nova.v2_0.binders.BindConsoleToJsonPayload;
-import org.jclouds.openstack.v2_0.services.Extension;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to Consoles via the REST API.
- *
- *
- * @see ConsoleApi
- * @see ExtensionAsyncApi
- */
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CONSOLES)
-@RequestFilters(AuthenticateRequest.class)
-public interface ConsolesAsyncApi {
- /**
- * @see ConsolesApi#getConsole
- */
- @Named("server:console")
- @POST
- @Path("/servers/{serverId}/action")
- @SelectJson("console")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- @Fallback(MapHttp4xxCodesToExceptions.class)
- @MapBinder(BindConsoleToJsonPayload.class)
- ListenableFuture extends Console> getConsole(@PathParam("serverId") String serverId,
- @PayloadParam("type") Console.Type type);
-
-}
-
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 9e6114140d..5856cd668f 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
@@ -17,60 +17,114 @@
package org.jclouds.openstack.nova.v2_0.extensions;
import java.util.Map;
+
+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.PUT;
+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.EmptyMapOnNotFoundOr404;
+import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.openstack.v2_0.services.Extension;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.Payload;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+import org.jclouds.rest.annotations.Unwrap;
+import org.jclouds.rest.binders.BindToJsonPayload;
import com.google.common.annotations.Beta;
/**
- * Provide access to extra metadata for Nova flavors.
+ * Provides access to the OpenStack Compute (Nova) Flavor Extra Specs Extension API.
*
- * @see
* @see org.jclouds.openstack.nova.v2_0.features.FlavorApi
- * @see org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsAsyncApi
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLAVOR_EXTRA_SPECS)
+@RequestFilters(AuthenticateRequest.class)
+@Consumes(MediaType.APPLICATION_JSON)
+@Path("/flavors")
public interface FlavorExtraSpecsApi {
-
/**
- * Retrieve all extra specs for a flavor
+ * Retrieves all extra specs for a flavor
*
* @return the set of extra metadata for the flavor
*/
- Map getMetadata(String flavorId);
+ @Named("flavorExtraSpecs:getMetadata")
+ @GET
+ @Path("/{id}/os-extra_specs")
+ @SelectJson("extra_specs")
+ @Fallback(EmptyMapOnNotFoundOr404.class)
+ Map getMetadata(@PathParam("id") String flavorId);
/**
* Creates or updates the extra specs for a given flavor
*
- * @param flavorId the id of the flavor to modify
- * @param specs the extra specs to apply
+ * @param flavorId the id of the flavor to modify
+ * @param specs the extra specs to apply
*/
- Boolean updateMetadata(String flavorId, Map specs);
+ @Named("flavorExtraSpecs:updateMetadata")
+ @POST
+ @Path("/{id}/os-extra_specs")
+ @Produces(MediaType.APPLICATION_JSON)
+ @MapBinder(BindToJsonPayload.class)
+ @Fallback(FalseOnNotFoundOr404.class)
+ Boolean updateMetadata(@PathParam("id") String flavorId,
+ @PayloadParam("extra_specs") Map specs);
/**
* Return a single extra spec value
*
- * @param flavorId the id of the flavor to modify
- * @param key the extra spec key to retrieve
+ * @param id the id of the flavor to modify
+ * @param key the extra spec key to retrieve
*/
- String getMetadataKey(String flavorId, String key);
+ @Named("flavorExtraSpecs:getMetadataKey")
+ @GET
+ @Path("/{id}/os-extra_specs/{key}")
+ @Unwrap
+ @Fallback(NullOnNotFoundOr404.class)
+ @Nullable
+ String getMetadataKey(@PathParam("id") String flavorId, @PathParam("key") String key);
/**
* Creates or updates a single extra spec value
*
- * @param flavorId the id of the flavor to modify
- * @param key the extra spec key (when creating ensure this does not include whitespace or other difficult characters)
- * @param value the value to associate with the key
+ * @param id the id of the flavor to modify
+ * @param key the extra spec key (when creating ensure this does not include whitespace or
+ * other difficult characters)
+ * @param value the value to associate with the key
*/
- Boolean updateMetadataEntry(String flavorId, String key, String value);
+ @Named("flavorExtraSpecs:updateMetadataEntry")
+ @PUT
+ @Path("/{id}/os-extra_specs/{key}")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Payload("%7B\"{key}\":\"{value}\"%7D")
+ @Fallback(FalseOnNotFoundOr404.class)
+ Boolean updateMetadataEntry(@PathParam("id") String flavorId,
+ @PathParam("key") @PayloadParam("key") String key, @PayloadParam("value") String value);
/**
* Deletes an extra spec
*
- * @param flavorId the id of the flavor to modify
- * @param key the extra spec key to delete
+ * @param id the id of the flavor to modify
+ * @param key the extra spec key to delete
*/
- Boolean deleteMetadataKey(String flavorId, String key);
-
+ @Named("flavorExtraSpecs:deleteMetadataKey")
+ @DELETE
+ @Path("/{id}/os-extra_specs/{key}")
+ @Fallback(FalseOnNotFoundOr404.class)
+ Boolean deleteMetadataKey(@PathParam("id") String flavorId, @PathParam("key") String key);
}
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java
deleted file mode 100644
index 8870233f81..0000000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsAsyncApi.java
+++ /dev/null
@@ -1,117 +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.nova.v2_0.extensions;
-
-import java.util.Map;
-
-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.PUT;
-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.EmptyMapOnNotFoundOr404;
-import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.openstack.v2_0.services.Extension;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.Payload;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Unwrap;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provide access to extra metadata for Nova flavors.
- *
- * @see
- * @see org.jclouds.openstack.nova.v2_0.features.FlavorApi
- * @see FlavorExtraSpecsApi
- */
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.FLAVOR_EXTRA_SPECS)
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-public interface FlavorExtraSpecsAsyncApi {
-
- /**
- * @see FlavorExtraSpecsApi#getMetadata(String)
- */
- @Named("flavor:getmetadata")
- @GET
- @SelectJson("extra_specs")
- @Path("/flavors/{flavor_id}/os-extra_specs")
- @Fallback(EmptyMapOnNotFoundOr404.class)
- ListenableFuture