openstack-nova: Adjusting names of ServerWithSecurityGroups related calls

This commit is contained in:
Adam Lowe 2012-05-04 17:07:14 +01:00
parent 33b4a2d253
commit 653d5ccc4b
7 changed files with 16 additions and 15 deletions

View File

@ -143,7 +143,7 @@ public interface NovaAsyncClient {
* Provides asynchronous access to Server Extra Data features. * Provides asynchronous access to Server Extra Data features.
*/ */
@Delegate @Delegate
Optional<ServerWithSecurityGroupsAsyncClient> getServerExtraDataExtensionForZone( Optional<ServerWithSecurityGroupsAsyncClient> getServerWithSecurityGroupsExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone); @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/** /**

View File

@ -126,7 +126,6 @@ public interface NovaClient {
Optional<SimpleTenantUsageClient> getSimpleTenantUsageExtensionForZone( Optional<SimpleTenantUsageClient> getSimpleTenantUsageExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone); @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/** /**
* Provides synchronous access to Volume features. * Provides synchronous access to Volume features.
*/ */
@ -141,17 +140,15 @@ public interface NovaClient {
Optional<VirtualInterfaceClient> getVirtualInterfaceExtensionForZone( Optional<VirtualInterfaceClient> getVirtualInterfaceExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone); @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/** /**
* Provides synchronous access to Server Extra Data features. * Provides synchronous access to Server Extra Data features.
*/ */
@Delegate @Delegate
Optional<ServerWithSecurityGroupsClient> getServerExtraDataExtensionForZone( Optional<ServerWithSecurityGroupsClient> getServerWithSecurityGroupsExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone); @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/** /**
* Provides asynchronous access to Server Admin Actions features. * Provides synchronous access to Server Admin Actions features.
*/ */
@Delegate @Delegate
Optional<AdminActionsClient> getAdminActionsExtensionForZone( Optional<AdminActionsClient> getAdminActionsExtensionForZone(

View File

@ -160,7 +160,7 @@ public class Image extends Resource {
/** /**
* @see Image#getMetadata() * @see Image#getMetadata()
*/ */
public T metadata(Map<java.lang.String, java.lang.String> metadata) { public T metadata(Map<String, String> metadata) {
this.metadata = metadata; this.metadata = metadata;
return self(); return self();
} }

View File

@ -38,10 +38,11 @@ import com.google.common.util.concurrent.ListenableFuture;
/** /**
* Provides synchronous access to Servers with Security Groups. * Provides synchronous access to Servers with Security Groups.
* *
* @author Adam Lowe
* @see org.jclouds.openstack.nova.v1_1.features.ServerAsyncClient * @see org.jclouds.openstack.nova.v1_1.features.ServerAsyncClient
* @see ServerWithSecurityGroupsClient * @see ServerWithSecurityGroupsClient
* @author Adam Lowe * @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.createserverext.html"/>
*/ */
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT) @Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT)
@SkipEncoding({'/', '='}) @SkipEncoding({'/', '='})

View File

@ -26,13 +26,16 @@ import org.jclouds.openstack.services.Extension;
import org.jclouds.openstack.services.ServiceType; import org.jclouds.openstack.services.ServiceType;
/** /**
* Provides synchronous access to Server details including security groups. * Provides synchronous access to Server details including security group, referred to as the CREATESERVEREXT extension
* in the nova documentation
* <p/> * <p/>
* NOTE: the equivalent to listServersInDetail() doesn't work, so not extending ServerClient at this time. * NOTE: the equivalent to listServersInDetail() isn't available at the other end, so not extending ServerClient at this
* time.
* *
* @author Adam Lowe * @author Adam Lowe
* @see org.jclouds.openstack.nova.v1_1.features.ServerClient * @see org.jclouds.openstack.nova.v1_1.features.ServerClient
* @see ServerWithSecurityGroupsAsyncClient * @see ServerWithSecurityGroupsAsyncClient
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.createserverext.html"/>
*/ */
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT) @Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT)
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)

View File

@ -30,7 +30,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* Tests parsing and guice wiring of ServerExtraDataClient * Tests parsing and guice wiring of ServerWithSecurityGroupsClient
* *
* @author Adam Lowe * @author Adam Lowe
*/ */
@ -44,7 +44,7 @@ public class ServerWithSecurityGroupsClientExpectTest extends BaseNovaClientExpe
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
standardRequestBuilder(endpoint).build(), standardRequestBuilder(endpoint).build(),
standardResponseBuilder(200).payload(payloadFromResource("/server_with_security_groups.json")).build() standardResponseBuilder(200).payload(payloadFromResource("/server_with_security_groups.json")).build()
).getServerExtraDataExtensionForZone("az-1.region-a.geo-1").get(); ).getServerWithSecurityGroupsExtensionForZone("az-1.region-a.geo-1").get();
ServerWithSecurityGroups server = client.getServer("8d0a6ca5-8849-4b3d-b86e-f24c92490ebb"); ServerWithSecurityGroups server = client.getServer("8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
assertEquals(server.getId(), "8d0a6ca5-8849-4b3d-b86e-f24c92490ebb"); assertEquals(server.getId(), "8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
@ -58,7 +58,7 @@ public class ServerWithSecurityGroupsClientExpectTest extends BaseNovaClientExpe
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
standardRequestBuilder(endpoint).build(), standardRequestBuilder(endpoint).build(),
standardResponseBuilder(404).build() standardResponseBuilder(404).build()
).getServerExtraDataExtensionForZone("az-1.region-a.geo-1").get(); ).getServerWithSecurityGroupsExtensionForZone("az-1.region-a.geo-1").get();
assertNull(client.getServer("8d0a6ca5-8849-4b3d-b86e-f24c92490ebb")); assertNull(client.getServer("8d0a6ca5-8849-4b3d-b86e-f24c92490ebb"));
} }
} }

View File

@ -50,7 +50,7 @@ public class ServerWithSecurityGroupsClientLiveTest extends BaseNovaClientLiveTe
super.setupContext(); super.setupContext();
zone = Iterables.getLast(novaContext.getApi().getConfiguredZones(), "nova"); zone = Iterables.getLast(novaContext.getApi().getConfiguredZones(), "nova");
serverClient = novaContext.getApi().getServerClientForZone(zone); serverClient = novaContext.getApi().getServerClientForZone(zone);
clientOption = novaContext.getApi().getServerExtraDataExtensionForZone(zone); clientOption = novaContext.getApi().getServerWithSecurityGroupsExtensionForZone(zone);
} }
public void testGetServer() { public void testGetServer() {