From 8c544ddef038c9cbe9e751fb6fcb344b1b604273 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Thu, 9 Aug 2012 15:55:35 +0100 Subject: [PATCH] Making more OpenStack Nova APIs extensible using generic return values --- .../nova/v2_0/compute/NovaComputeServiceAdapter.java | 4 ++-- .../org/jclouds/openstack/nova/v2_0/features/FlavorApi.java | 2 +- .../jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java | 4 ++-- .../org/jclouds/openstack/nova/v2_0/features/ImageApi.java | 2 +- .../jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java | 4 ++-- .../openstack/nova/v2_0/features/FlavorApiLiveTest.java | 2 +- .../openstack/nova/v2_0/features/ImageApiLiveTest.java | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) 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 de6e825cf8..f2b51380d5 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 @@ -159,12 +159,12 @@ public class NovaComputeServiceAdapter implements Set zones = zoneIds.get(); checkState(zones.size() > 0, "no zones found in supplier %s", zoneIds); for (final String zoneId : zones) { - Set images = novaApi.getImageApiForZone(zoneId).listImagesInDetail(); + Set images = novaApi.getImageApiForZone(zoneId).listImagesInDetail(); if (images.size() == 0) { logger.debug("no images found in zone %s", zoneId); continue; } - Iterable active = filter(images, ImagePredicates.statusEquals(Image.Status.ACTIVE)); + Iterable active = filter(images, ImagePredicates.statusEquals(Image.Status.ACTIVE)); if (images.size() == 0) { logger.debug("no images with status active in zone %s; non-active: %s", zoneId, transform(active, new Function() { diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java index b9aec3d732..8bb523caad 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java @@ -50,7 +50,7 @@ public interface FlavorApi { * * @return all flavors (all details) */ - Set listFlavorsInDetail(); + Set listFlavorsInDetail(); /** * List details of the specified flavor diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java index ce154bf7d0..ac010c2eb7 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java @@ -71,7 +71,7 @@ public interface FlavorAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/flavors/detail") @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class) - ListenableFuture> listFlavorsInDetail(); + ListenableFuture> listFlavorsInDetail(); /** * @see FlavorApi#getFlavor @@ -81,6 +81,6 @@ public interface FlavorAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/flavors/{id}") @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture getFlavor(@PathParam("id") String id); + ListenableFuture getFlavor(@PathParam("id") String id); } diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java index 9ef897286b..dc31674d38 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java @@ -50,7 +50,7 @@ public interface ImageApi { * * @return all images (all details) */ - Set listImagesInDetail(); + Set listImagesInDetail(); /** * List details of the specified image diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java index 0682281106..0c623d3866 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java @@ -69,7 +69,7 @@ public interface ImageAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/images/detail") @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class) - ListenableFuture> listImagesInDetail(); + ListenableFuture> listImagesInDetail(); /** * @see ImageApi#getImage @@ -79,7 +79,7 @@ public interface ImageAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/images/{id}") @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture getImage(@PathParam("id") String id); + ListenableFuture getImage(@PathParam("id") String id); /** * @see ImageApi#deleteImage diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java index 89d9c8e0f5..1374911027 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java @@ -66,7 +66,7 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest { public void testListFlavorsInDetail() throws Exception { for (String zoneId : novaContext.getApi().getConfiguredZones()) { FlavorApi api = novaContext.getApi().getFlavorApiForZone(zoneId); - Set response = api.listFlavorsInDetail(); + Set response = api.listFlavorsInDetail(); assert null != response; assertTrue(response.size() >= 0); for (Flavor flavor : response) { diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java index 792a6cc07c..80237740c3 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java @@ -58,7 +58,7 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest { public void testListImagesInDetail() throws Exception { for (String zoneId : novaContext.getApi().getConfiguredZones()) { ImageApi api = novaContext.getApi().getImageApiForZone(zoneId); - Set response = api.listImagesInDetail(); + Set response = api.listImagesInDetail(); assertNotNull(response); assertTrue(response.size() >= 0); for (Image image : response) {