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.
*/
@Delegate
Optional<ServerWithSecurityGroupsAsyncClient> getServerExtraDataExtensionForZone(
Optional<ServerWithSecurityGroupsAsyncClient> getServerWithSecurityGroupsExtensionForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
/**

View File

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

View File

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

View File

@ -39,9 +39,10 @@ import com.google.common.util.concurrent.ListenableFuture;
/**
* Provides synchronous access to Servers with Security Groups.
*
* @author Adam Lowe
* @see org.jclouds.openstack.nova.v1_1.features.ServerAsyncClient
* @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)
@SkipEncoding({'/', '='})

View File

@ -26,13 +26,16 @@ import org.jclouds.openstack.services.Extension;
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/>
* 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
* @see org.jclouds.openstack.nova.v1_1.features.ServerClient
* @see ServerWithSecurityGroupsAsyncClient
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.createserverext.html"/>
*/
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT)
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)

View File

@ -30,7 +30,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
/**
* Tests parsing and guice wiring of ServerExtraDataClient
* Tests parsing and guice wiring of ServerWithSecurityGroupsClient
*
* @author Adam Lowe
*/
@ -44,7 +44,7 @@ public class ServerWithSecurityGroupsClientExpectTest extends BaseNovaClientExpe
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
standardRequestBuilder(endpoint).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");
assertEquals(server.getId(), "8d0a6ca5-8849-4b3d-b86e-f24c92490ebb");
@ -58,7 +58,7 @@ public class ServerWithSecurityGroupsClientExpectTest extends BaseNovaClientExpe
responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
standardRequestBuilder(endpoint).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"));
}
}

View File

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