You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2014/04/19 15:01:43 UTC
git commit: JCLOUDS-526: Removing Nova QuotaClassApi
Repository: jclouds
Updated Branches:
refs/heads/master 5fabd8768 -> b2be14994
JCLOUDS-526: Removing Nova QuotaClassApi
The quota-classes API in Nova has been removed (and apparently never worked)
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/b2be1499
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/b2be1499
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/b2be1499
Branch: refs/heads/master
Commit: b2be1499460b49de85c20161c022cee86998a638
Parents: 5fabd87
Author: jasdeep-hundal <ja...@gmail.com>
Authored: Tue Apr 8 15:12:12 2014 -0700
Committer: Andrew Phillips <an...@apache.org>
Committed: Sat Apr 19 09:00:50 2014 -0400
----------------------------------------------------------------------
.../jclouds/openstack/nova/v2_0/NovaApi.java | 8 --
.../openstack/nova/v2_0/NovaAsyncApi.java | 8 --
.../nova/v2_0/config/NovaRestClientModule.java | 11 +-
.../openstack/nova/v2_0/domain/QuotaClass.java | 62 -----------
.../v2_0/extensions/ExtensionNamespaces.java | 5 -
.../nova/v2_0/extensions/QuotaClassApi.java | 51 ---------
.../v2_0/extensions/QuotaClassAsyncApi.java | 78 --------------
.../extensions/QuotaClassApiExpectTest.java | 105 -------------------
.../v2_0/extensions/QuotaClassApiLiveTest.java | 73 -------------
.../src/test/resources/extension_list_full.json | 10 +-
.../src/test/resources/quota_class.json | 15 ---
11 files changed, 4 insertions(+), 422 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
----------------------------------------------------------------------
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 b03727e..8a01a83 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
@@ -28,7 +28,6 @@ import org.jclouds.openstack.nova.v2_0.extensions.HostAdministrationApi;
import org.jclouds.openstack.nova.v2_0.extensions.HostAggregateApi;
import org.jclouds.openstack.nova.v2_0.extensions.KeyPairApi;
import org.jclouds.openstack.nova.v2_0.extensions.QuotaApi;
-import org.jclouds.openstack.nova.v2_0.extensions.QuotaClassApi;
import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
import org.jclouds.openstack.nova.v2_0.extensions.ServerAdminApi;
import org.jclouds.openstack.nova.v2_0.extensions.ServerWithSecurityGroupsApi;
@@ -178,13 +177,6 @@ public interface NovaApi extends Closeable {
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides synchronous access to Quota Classes features.
- */
- @Delegate
- Optional<? extends QuotaClassApi> getQuotaClassExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
* Provides synchronous access to Volume features.
*/
@Delegate
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java
----------------------------------------------------------------------
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
index 9abea53..e0ee52f 100644
--- 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
@@ -29,7 +29,6 @@ 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.QuotaClassAsyncApi;
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;
@@ -184,13 +183,6 @@ public interface NovaAsyncApi extends Closeable {
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**
- * Provides asynchronous access to Quota Classes features.
- */
- @Delegate
- Optional<? extends QuotaClassAsyncApi> getQuotaClassExtensionForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
* Provides asynchronous access to Volume features.
*/
@Delegate
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java
----------------------------------------------------------------------
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/NovaRestClientModule.java
index 556ec60..ea0d947 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/NovaRestClientModule.java
@@ -46,8 +46,6 @@ 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.QuotaClassApi;
-import org.jclouds.openstack.nova.v2_0.extensions.QuotaClassAsyncApi;
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;
@@ -90,7 +88,7 @@ import com.google.inject.Provides;
/**
* Configures the Nova connection.
- *
+ *
* @author Adrian Cole
*/
@ConfiguresRestClient
@@ -113,12 +111,11 @@ public class NovaRestClientModule<S extends NovaApi, A extends NovaAsyncApi> ext
.put(HostAggregateApi.class, HostAggregateAsyncApi.class)
.put(FlavorExtraSpecsApi.class, FlavorExtraSpecsAsyncApi.class)
.put(QuotaApi.class, QuotaAsyncApi.class)
- .put(QuotaClassApi.class, QuotaClassAsyncApi.class)
.put(VolumeApi.class, VolumeAsyncApi.class)
.put(VolumeAttachmentApi.class, VolumeAttachmentAsyncApi.class)
.put(VolumeTypeApi.class, VolumeTypeAsyncApi.class)
.build();
-
+
@SuppressWarnings("unchecked")
public NovaRestClientModule() {
super(TypeToken.class.cast(typeToken(NovaApi.class)), TypeToken.class.cast(typeToken(NovaAsyncApi.class)), DELEGATE_MAP);
@@ -134,7 +131,7 @@ public class NovaRestClientModule<S extends NovaApi, A extends NovaAsyncApi> ext
bind(ImplicitOptionalConverter.class).to(PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.class);
super.configure();
}
-
+
@Provides
@Singleton
public Multimap<URI, URI> aliases() {
@@ -163,8 +160,6 @@ public class NovaRestClientModule<S extends NovaApi, A extends NovaAsyncApi> ext
URI.create("http://docs.openstack.org/compute/ext/flavor_extra_specs/api/v1.1"))
.put(URI.create(ExtensionNamespaces.QUOTAS),
URI.create("http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1"))
- .put(URI.create(ExtensionNamespaces.QUOTA_CLASSES),
- URI.create("http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1"))
.put(URI.create(ExtensionNamespaces.VOLUME_TYPES),
URI.create("http://docs.openstack.org/compute/ext/volume_types/api/v1.1"))
.build();
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/QuotaClass.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/QuotaClass.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/QuotaClass.java
deleted file mode 100644
index 27199ef..0000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/QuotaClass.java
+++ /dev/null
@@ -1,62 +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.domain;
-
-import java.beans.ConstructorProperties;
-
-/**
- * Represents the set of limits (quota class) returned by the Quota Class Extension
- *
- * @see org.jclouds.openstack.nova.v2_0.extensions.QuotaClassApi
-*/
-public class QuotaClass extends Quota {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromQuotaClass(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Quota.Builder<T> {
-
- public QuotaClass build() {
- return new QuotaClass(id, metadataItems, injectedFileContentBytes, volumes, gigabytes, ram, floatingIps, instances, injectedFiles, cores, securityGroups, securityGroupRules, keyPairs);
- }
-
- public T fromQuotaClass(QuotaClass in) {
- return super.fromQuotas(in);
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
-
- @ConstructorProperties({
- "id", "metadata_items", "injected_file_content_bytes", "volumes", "gigabytes", "ram", "floating_ips", "instances", "injected_files", "cores", "security_groups", "security_group_rules", "key_pairs"
- })
- protected QuotaClass(String id, int metadataItems, int injectedFileContentBytes, int volumes, int gigabytes, int ram, int floatingIps, int instances, int injectedFiles, int cores, int securityGroups, int securityGroupRules, int keyPairs) {
- super(id, metadataItems, injectedFileContentBytes, volumes, gigabytes, ram, floatingIps, instances, injectedFiles, cores, securityGroups, securityGroupRules, keyPairs);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
index a249190..98cddd8 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
@@ -94,11 +94,6 @@ public interface ExtensionNamespaces {
public static final String EXTENDED_STATUS = "http://docs.openstack.org/compute/ext/extended_status/api/v1.1";
/**
- * Quota Classes extension
- */
- public static final String QUOTA_CLASSES = "http://docs.openstack.org/ext/quota-classes-sets/api/v1.1";
-
- /**
* Disk Config extension
*/
public static final String DISK_CONFIG = "http://docs.openstack.org/compute/ext/disk_config/api/v1.1";
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApi.java
deleted file mode 100644
index 4a6c010..0000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApi.java
+++ /dev/null
@@ -1,51 +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 org.jclouds.openstack.nova.v2_0.domain.QuotaClass;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.openstack.v2_0.services.Extension;
-
-import com.google.common.annotations.Beta;
-
-/**
- * Provides synchronous access to Quota Classes via the REST API.
- * <p/>
- * To use this extension, you need to have administrative rights to the tenants upon which you are placing quotas.
- *
- * @author Adam Lowe
- * @see QuotaClassAsyncApi
- * @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.quota_classes.html"/>
- * @see <a href="http://wiki.openstack.org/QuotaClass"/>
- */
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.QUOTA_CLASSES)
-public interface QuotaClassApi {
-
- /**
- * @return the quota settings for the tenant
- */
- QuotaClass get(String id);
-
- /**
- * Update the quotas for a given tenant
- *
- * @return true if successful
- */
- boolean update(String id, QuotaClass quotas);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassAsyncApi.java
deleted file mode 100644
index f07148f..0000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassAsyncApi.java
+++ /dev/null
@@ -1,78 +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.GET;
-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.NullOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.QuotaClass;
-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 org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to Quota Classes via the REST API.
- *
- * @author Adam Lowe
- * @see QuotaClassApi
- * @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.quota_classes.html"/>
- * @see <a href="http://wiki.openstack.org/QuotaClass"/>
- */
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.QUOTA_CLASSES)
-@RequestFilters(AuthenticateRequest.class)
-@Path("/os-quota-class-sets")
-public interface QuotaClassAsyncApi {
-
- /**
- * @see QuotaClassApi#get
- */
- @Named("quotaclass:get")
- @GET
- @SelectJson("quota_class_set")
- @Consumes(MediaType.APPLICATION_JSON)
- @Path("/{id}")
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<? extends QuotaClass> get(@PathParam("id") String id);
-
- /**
- * @see QuotaClassApi#update
- */
- @Named("quotaclass:update")
- @PUT
- @Path("/{id}")
- @Produces(MediaType.APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- ListenableFuture<Boolean> update(@PathParam("id") String id, @PayloadParam("quota_class_set") QuotaClass quotas);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java
deleted file mode 100644
index 4611ea9..0000000
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiExpectTest.java
+++ /dev/null
@@ -1,105 +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 static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.nova.v2_0.domain.QuotaClass;
-import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-/**
- * Tests HostAdministrationApi guice wiring and parsing
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "QuotaClassApiExpectTest")
-public class QuotaClassApiExpectTest extends BaseNovaApiExpectTest {
-
- public void testGetQuotas() throws Exception {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/jcloudstestquotas");
- QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/quota_class.json")).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
-
- assertEquals(api.get("jcloudstestquotas"), getTestQuotas());
- }
-
- public void testGetQuotasFailsTenantNotFound() throws Exception {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/jcloudstestquotas");
- QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(404).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
- assertNull(api.get("jcloudstestquotas"));
- }
-
- public void testUpdateQuotas() throws Exception {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/myclass");
- QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- HttpRequest.builder().endpoint(endpoint).method("PUT")
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromResourceWithContentType("/quota_class.json", MediaType.APPLICATION_JSON))
- .build(),
- HttpResponse.builder().statusCode(200).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
-
- assertTrue(api.update("myclass", getTestQuotas()));
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testUpdateQuotasFailsNotFound() throws Exception {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-quota-class-sets/jcloudstestquotas");
- QuotaClassApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- HttpRequest.builder().endpoint(endpoint).method("PUT")
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromResourceWithContentType("/quota_class.json", MediaType.APPLICATION_JSON))
- .build(),
- HttpResponse.builder().statusCode(404).build()).getQuotaClassExtensionForZone("az-1.region-a.geo-1").get();
-
- api.update("jcloudstestquotas", getTestQuotas());
- }
-
- public static QuotaClass getTestQuotas() {
- return QuotaClass.builder()
- .metadataItems(128)
- .injectedFileContentBytes(10240)
- .injectedFiles(5)
- .gigabytes(1000)
- .ram(4096)
- .floatingIps(10)
- .securityGroups(10)
- .securityGroupRules(20)
- .instances(5)
- .keyPairs(100)
- .volumes(5)
- .cores(10)
- .id("jcloudstestquotas").build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java
deleted file mode 100644
index 43fd342..0000000
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaClassApiLiveTest.java
+++ /dev/null
@@ -1,73 +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 static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.openstack.nova.v2_0.domain.QuotaClass;
-import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.Iterables;
-
-/**
- * Tests behavior of QuotaApi
- *
- * @author Adam Lowe
- */
-@Test(groups = "live", testName = "QuotaClassApiLiveTest", singleThreaded = true)
-public class QuotaClassApiLiveTest extends BaseNovaApiLiveTest {
- private Optional<? extends QuotaClassApi> apiOption;
- private String zone;
-
- @BeforeClass(groups = {"integration", "live"})
- @Override
- public void setup() {
- super.setup();
- zone = Iterables.getLast(api.getConfiguredZones(), "nova");
- apiOption = api.getQuotaClassExtensionForZone(zone);
- }
-
- public void testUpdateAndGetQuotaClass() {
- if (apiOption.isPresent()) {
- QuotaClassApi api = apiOption.get();
-
- QuotaClass firstVersion =
- QuotaClassApiExpectTest.getTestQuotas().toBuilder()
- .id("jcloudstestquotas")
- .cores(10)
- .instances(5)
- .ram(4096)
- .volumes(5)
- .build();
-
- assertTrue(api.update(firstVersion.getId(), firstVersion));
-
- assertEquals(api.get(firstVersion.getId()), firstVersion);
-
- // Change it again (since we may have run this test before and we can't delete the QuotaClass)
- QuotaClass secondVersion = firstVersion.toBuilder().ram(8192).build();
-
- assertTrue(api.update(secondVersion.getId(), secondVersion));
-
- assertEquals(api.get(secondVersion.getId()), secondVersion);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/test/resources/extension_list_full.json
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/resources/extension_list_full.json b/apis/openstack-nova/src/test/resources/extension_list_full.json
index 490bebc..61909ce 100644
--- a/apis/openstack-nova/src/test/resources/extension_list_full.json
+++ b/apis/openstack-nova/src/test/resources/extension_list_full.json
@@ -192,14 +192,6 @@
"description": "Start/Stop instance compute API support"
},
{
- "updated": "2012-03-12T00:00:00+00:00",
- "name": "QuotaClasses",
- "links": [],
- "namespace": "http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1",
- "alias": "os-quota-class-sets",
- "description": "Quota classes management support"
-},
-{
"updated": "2012-01-19T00:00:00+00:00",
"name": "Certificates",
"links": [],
@@ -278,4 +270,4 @@
"namespace": "http://docs.openstack.org/compute/ext/floating_ips/api/v1.1",
"alias": "os-floating-ips",
"description": "Floating IPs support"}
-]}
\ No newline at end of file
+]}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b2be1499/apis/openstack-nova/src/test/resources/quota_class.json
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/resources/quota_class.json b/apis/openstack-nova/src/test/resources/quota_class.json
deleted file mode 100644
index 837b9cc..0000000
--- a/apis/openstack-nova/src/test/resources/quota_class.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{"quota_class_set": {
- "metadata_items": 128,
- "injected_file_content_bytes": 10240,
- "injected_files": 5,
- "gigabytes": 1000,
- "ram": 4096,
- "floating_ips": 10,
- "security_group_rules": 20,
- "instances": 5,
- "key_pairs": 100,
- "volumes": 5,
- "cores": 10,
- "id": "jcloudstestquotas",
- "security_groups": 10
-}}
\ No newline at end of file