mirror of https://github.com/apache/jclouds.git
Merge pull request #795 from grkvlt/openstack-nova-extension-extensibility
Make all Nova extensions extensible
This commit is contained in:
commit
4cd8d17e82
|
@ -155,7 +155,7 @@ public class NovaComputeService extends BaseComputeService {
|
|||
Optional<? extends KeyPairApi> keyPairApi = novaApi.getKeyPairExtensionForZone(zoneId);
|
||||
if (keyPairApi.isPresent()) {
|
||||
for (String group : groups) {
|
||||
for (Map<String, KeyPair> view : keyPairApi.get().listKeyPairs()) {
|
||||
for (Map<String, ? extends KeyPair> view : keyPairApi.get().listKeyPairs()) {
|
||||
for (KeyPair pair : Iterables.filter(view.values(),
|
||||
KeyPairPredicates.nameMatches(namingConvention.create().containsGroup(group)))) {
|
||||
ZoneAndName zoneAndName = ZoneAndName.fromZoneAndName(zoneId, pair.getName());
|
||||
|
|
|
@ -129,7 +129,7 @@ public class NovaComputeServiceContextModule extends
|
|||
|
||||
bind(TemplateOptions.class).to(NovaTemplateOptions.class);
|
||||
|
||||
bind(new TypeLiteral<CacheLoader<ZoneAndId, Iterable<FloatingIP>>>() {
|
||||
bind(new TypeLiteral<CacheLoader<ZoneAndId, Iterable<? extends FloatingIP>>>() {
|
||||
}).annotatedWith(Names.named("FLOATINGIP")).to(LoadFloatingIpsForInstance.class);
|
||||
|
||||
bind(new TypeLiteral<Function<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone>>() {
|
||||
|
@ -163,8 +163,8 @@ public class NovaComputeServiceContextModule extends
|
|||
@Provides
|
||||
@Singleton
|
||||
@Named("FLOATINGIP")
|
||||
protected LoadingCache<ZoneAndId, Iterable<FloatingIP>> instanceToFloatingIps(
|
||||
@Named("FLOATINGIP") CacheLoader<ZoneAndId, Iterable<FloatingIP>> in) {
|
||||
protected LoadingCache<ZoneAndId, Iterable<? extends FloatingIP>> instanceToFloatingIps(
|
||||
@Named("FLOATINGIP") CacheLoader<ZoneAndId, Iterable<? extends FloatingIP>> in) {
|
||||
return CacheBuilder.newBuilder().build(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -61,11 +61,11 @@ public class AllocateAndAddFloatingIpToNode implements
|
|||
|
||||
private final Predicate<AtomicReference<NodeMetadata>> nodeRunning;
|
||||
private final NovaApi novaApi;
|
||||
private final LoadingCache<ZoneAndId, Iterable<FloatingIP>> floatingIpCache;
|
||||
private final LoadingCache<ZoneAndId, Iterable<? extends FloatingIP>> floatingIpCache;
|
||||
|
||||
@Inject
|
||||
public AllocateAndAddFloatingIpToNode(@Named(TIMEOUT_NODE_RUNNING) Predicate<AtomicReference<NodeMetadata>> nodeRunning,
|
||||
NovaApi novaApi, @Named("FLOATINGIP") LoadingCache<ZoneAndId, Iterable<FloatingIP>> floatingIpCache) {
|
||||
NovaApi novaApi, @Named("FLOATINGIP") LoadingCache<ZoneAndId, Iterable<? extends FloatingIP>> floatingIpCache) {
|
||||
this.nodeRunning = checkNotNull(nodeRunning, "nodeRunning");
|
||||
this.novaApi = checkNotNull(novaApi, "novaApi");
|
||||
this.floatingIpCache = checkNotNull(floatingIpCache, "floatingIpCache");
|
||||
|
|
|
@ -47,11 +47,11 @@ public class RemoveFloatingIpFromNodeAndDeallocate implements Function<ZoneAndId
|
|||
protected Logger logger = Logger.NULL;
|
||||
|
||||
private final NovaApi novaApi;
|
||||
private final LoadingCache<ZoneAndId, Iterable<FloatingIP>> floatingIpCache;
|
||||
private final LoadingCache<ZoneAndId, Iterable<? extends FloatingIP>> floatingIpCache;
|
||||
|
||||
@Inject
|
||||
public RemoveFloatingIpFromNodeAndDeallocate(NovaApi novaApi,
|
||||
@Named("FLOATINGIP") LoadingCache<ZoneAndId, Iterable<FloatingIP>> floatingIpCache) {
|
||||
@Named("FLOATINGIP") LoadingCache<ZoneAndId, Iterable<? extends FloatingIP>> floatingIpCache) {
|
||||
this.novaApi = checkNotNull(novaApi, "novaApi");
|
||||
this.floatingIpCache = checkNotNull(floatingIpCache, "floatingIpCache");
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ import com.google.common.collect.Iterables;
|
|||
* @author Adam Lowe
|
||||
*/
|
||||
@Singleton
|
||||
public class LoadFloatingIpsForInstance extends CacheLoader<ZoneAndId, Iterable<FloatingIP>> {
|
||||
public class LoadFloatingIpsForInstance extends CacheLoader<ZoneAndId, Iterable<? extends FloatingIP>> {
|
||||
private final NovaApi api;
|
||||
|
||||
@Inject
|
||||
|
@ -49,7 +49,7 @@ public class LoadFloatingIpsForInstance extends CacheLoader<ZoneAndId, Iterable<
|
|||
}
|
||||
|
||||
@Override
|
||||
public Iterable<FloatingIP> load(final ZoneAndId key) throws Exception {
|
||||
public Iterable<? extends FloatingIP> load(final ZoneAndId key) throws Exception {
|
||||
String zone = key.getZone();
|
||||
Optional<? extends FloatingIPApi> ipApiOptional = api.getFloatingIPExtensionForZone(zone);
|
||||
if (ipApiOptional.isPresent()) {
|
||||
|
|
|
@ -174,8 +174,13 @@ public class KeyPair {
|
|||
}
|
||||
|
||||
protected ToStringHelper string() {
|
||||
return Objects.toStringHelper(this)
|
||||
.add("publicKey", publicKey).add("privateKey", privateKey).add("userId", userId).add("name", name).add("fingerprint", fingerprint);
|
||||
return Objects.toStringHelper("")
|
||||
.omitNullValues()
|
||||
.add("public_key", publicKey)
|
||||
.add("private_key", privateKey)
|
||||
.add("user_id", userId)
|
||||
.add("name", name)
|
||||
.add("fingerprint", fingerprint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,7 +42,7 @@ public interface FloatingIPApi {
|
|||
*
|
||||
* @return all Floating IPs
|
||||
*/
|
||||
Set<FloatingIP> listFloatingIPs();
|
||||
Set<? extends FloatingIP> listFloatingIPs();
|
||||
|
||||
/**
|
||||
* Get a specific Floating IP address
|
||||
|
|
|
@ -70,7 +70,7 @@ public interface FloatingIPAsyncApi {
|
|||
@SelectJson("floating_ips")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<FloatingIP>> listFloatingIPs();
|
||||
ListenableFuture<? extends Set<? extends FloatingIP>> listFloatingIPs();
|
||||
|
||||
/**
|
||||
* @see FloatingIPApi#getFloatingIP
|
||||
|
@ -80,7 +80,7 @@ public interface FloatingIPAsyncApi {
|
|||
@SelectJson("floating_ip")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<FloatingIP> getFloatingIP(@PathParam("id") String id);
|
||||
ListenableFuture<? extends FloatingIP> getFloatingIP(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see FloatingIPApi#allocate
|
||||
|
@ -92,7 +92,7 @@ public interface FloatingIPAsyncApi {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
@Payload("{}")
|
||||
ListenableFuture<FloatingIP> allocate();
|
||||
ListenableFuture<? extends FloatingIP> allocate();
|
||||
|
||||
/**
|
||||
* @see FloatingIPApi#deallocate
|
||||
|
|
|
@ -43,14 +43,14 @@ public interface HostAdministrationApi {
|
|||
*
|
||||
* @return the usage information
|
||||
*/
|
||||
Set<Host> listHosts();
|
||||
Set<? extends Host> listHosts();
|
||||
|
||||
/**
|
||||
* Retrieves the physical/usage resource on a specific host
|
||||
*
|
||||
* @return the usage information
|
||||
*/
|
||||
Set<HostResourceUsage> getHostResourceUsage(String hostId);
|
||||
Set<? extends HostResourceUsage> getHostResourceUsage(String hostId);
|
||||
|
||||
/**
|
||||
* Allow the specified host to accept new instances.
|
||||
|
|
|
@ -73,7 +73,7 @@ public interface HostAdministrationAsyncApi {
|
|||
@GET
|
||||
@SelectJson("hosts")
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<Host>> listHosts();
|
||||
ListenableFuture<? extends Set<? extends Host>> listHosts();
|
||||
|
||||
/**
|
||||
* @see HostAdministrationApi#getHostResourceUsage(String)
|
||||
|
@ -82,7 +82,7 @@ public interface HostAdministrationAsyncApi {
|
|||
@Path("/{id}")
|
||||
@SelectJson("host")
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<HostResourceUsage>> getHostResourceUsage(@PathParam("id") String hostId);
|
||||
ListenableFuture<? extends Set<? extends HostResourceUsage>> getHostResourceUsage(@PathParam("id") String hostId);
|
||||
|
||||
/**
|
||||
* @see HostAdministrationApi#enableHost(String)
|
||||
|
|
|
@ -45,7 +45,7 @@ public interface HostAggregateApi {
|
|||
/**
|
||||
* @return the set of host aggregates.
|
||||
*/
|
||||
Set<HostAggregate> listAggregates();
|
||||
Set<? extends HostAggregate> listAggregates();
|
||||
|
||||
/**
|
||||
* Retrieves the details of an aggregate, hosts and metadata included.
|
||||
|
|
|
@ -66,7 +66,7 @@ public interface HostAggregateAsyncApi {
|
|||
@SelectJson("aggregates")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<HostAggregate>> listAggregates();
|
||||
ListenableFuture<? extends Set<? extends HostAggregate>> listAggregates();
|
||||
|
||||
/**
|
||||
* @see HostAggregateApi#getAggregate(String)
|
||||
|
@ -76,7 +76,7 @@ public interface HostAggregateAsyncApi {
|
|||
@SelectJson("aggregate")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<HostAggregate> getAggregate(@PathParam("id") String id);
|
||||
ListenableFuture<? extends HostAggregate> getAggregate(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see HostAggregateApi#createAggregate(String, String)
|
||||
|
@ -86,7 +86,7 @@ public interface HostAggregateAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("aggregate")
|
||||
ListenableFuture<HostAggregate> createAggregate(@PayloadParam("name") String name,
|
||||
ListenableFuture<? extends HostAggregate> createAggregate(@PayloadParam("name") String name,
|
||||
@PayloadParam("availability_zone") String availabilityZone);
|
||||
|
||||
/**
|
||||
|
@ -97,7 +97,7 @@ public interface HostAggregateAsyncApi {
|
|||
@SelectJson("aggregate")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("aggregate")
|
||||
ListenableFuture<HostAggregate> updateName(@PathParam("id") String id, @PayloadParam("name") String name);
|
||||
ListenableFuture<? extends HostAggregate> updateName(@PathParam("id") String id, @PayloadParam("name") String name);
|
||||
|
||||
/**
|
||||
* @see HostAggregateApi#updateAvailabilityZone
|
||||
|
@ -107,7 +107,7 @@ public interface HostAggregateAsyncApi {
|
|||
@SelectJson("aggregate")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("aggregate")
|
||||
ListenableFuture<HostAggregate> updateAvailabilityZone(@PathParam("id") String id, @PayloadParam("availability_zone") String availabilityZone);
|
||||
ListenableFuture<? extends HostAggregate> updateAvailabilityZone(@PathParam("id") String id, @PayloadParam("availability_zone") String availabilityZone);
|
||||
|
||||
/**
|
||||
* @see HostAggregateApi#deleteAggregate(String)
|
||||
|
@ -127,7 +127,7 @@ public interface HostAggregateAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("add_host")
|
||||
ListenableFuture<HostAggregate> addHost(@PathParam("id") String id, @PayloadParam("host") String host);
|
||||
ListenableFuture<? extends HostAggregate> addHost(@PathParam("id") String id, @PayloadParam("host") String host);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -139,7 +139,7 @@ public interface HostAggregateAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("remove_host")
|
||||
ListenableFuture<HostAggregate> removeHost(@PathParam("id") String id, @PayloadParam("host") String host);
|
||||
ListenableFuture<? extends HostAggregate> removeHost(@PathParam("id") String id, @PayloadParam("host") String host);
|
||||
|
||||
/**
|
||||
* @see HostAggregateApi#setMetadata
|
||||
|
@ -150,5 +150,5 @@ public interface HostAggregateAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("set_metadata")
|
||||
ListenableFuture<HostAggregate> setMetadata(@PathParam("id") String id, @PayloadParam("metadata") Map<String, String> metadata);
|
||||
ListenableFuture<? extends HostAggregate> setMetadata(@PathParam("id") String id, @PayloadParam("metadata") Map<String, String> metadata);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public interface KeyPairApi {
|
|||
*
|
||||
* @return all Key Pairs
|
||||
*/
|
||||
Set<Map<String, KeyPair>> listKeyPairs();
|
||||
Set<? extends Map<String, ? extends KeyPair>> listKeyPairs();
|
||||
|
||||
/**
|
||||
* Create a Key Pair.
|
||||
|
|
|
@ -69,7 +69,7 @@ public interface KeyPairAsyncApi {
|
|||
@SelectJson("keypairs")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<Map<String, KeyPair>>> listKeyPairs();
|
||||
ListenableFuture<? extends Set<? extends Map<String, ? extends KeyPair>>> listKeyPairs();
|
||||
|
||||
@POST
|
||||
@Path("/os-keypairs")
|
||||
|
@ -77,7 +77,7 @@ public interface KeyPairAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Payload("%7B\"keypair\":%7B\"name\":\"{name}\"%7D%7D")
|
||||
ListenableFuture<KeyPair> createKeyPair(@PayloadParam("name") String name);
|
||||
ListenableFuture<? extends KeyPair> createKeyPair(@PayloadParam("name") String name);
|
||||
|
||||
@POST
|
||||
@Path("/os-keypairs")
|
||||
|
@ -85,7 +85,7 @@ public interface KeyPairAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Payload("%7B\"keypair\":%7B\"name\":\"{name}\",\"public_key\":\"{publicKey}\"%7D%7D")
|
||||
ListenableFuture<KeyPair> createKeyPairWithPublicKey(@PayloadParam("name") String name,
|
||||
ListenableFuture<? extends KeyPair> createKeyPairWithPublicKey(@PayloadParam("name") String name,
|
||||
@PayloadParam("publicKey") String publicKey);
|
||||
|
||||
@DELETE
|
||||
|
|
|
@ -64,7 +64,7 @@ public interface QuotaAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/{tenant_id}")
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<Quotas> getQuotasForTenant(@PathParam("tenant_id") String tenantId);
|
||||
ListenableFuture<? extends Quotas> getQuotasForTenant(@PathParam("tenant_id") String tenantId);
|
||||
|
||||
/**
|
||||
* @see QuotaApi#updateQuotasForTenant(String, org.jclouds.openstack.nova.v2_0.domain.Quotas)
|
||||
|
@ -83,6 +83,6 @@ public interface QuotaAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/{tenant_id}/defaults")
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<Quotas> getDefaultQuotasForTenant(@PathParam("tenant_id") String tenantId);
|
||||
ListenableFuture<? extends Quotas> getDefaultQuotasForTenant(@PathParam("tenant_id") String tenantId);
|
||||
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public interface QuotaClassAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/{id}")
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<QuotaClass> getQuotaClass(@PathParam("id") String id);
|
||||
ListenableFuture<? extends QuotaClass> getQuotaClass(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see QuotaClassApi#updateQuotaClass
|
||||
|
|
|
@ -44,7 +44,7 @@ public interface SecurityGroupApi {
|
|||
*
|
||||
* @return all Floating IPs
|
||||
*/
|
||||
Set<SecurityGroup> listSecurityGroups();
|
||||
Set<? extends SecurityGroup> listSecurityGroups();
|
||||
|
||||
/**
|
||||
* Get a specific Security Group
|
||||
|
|
|
@ -73,7 +73,7 @@ public interface SecurityGroupAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/os-security-groups")
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<SecurityGroup>> listSecurityGroups();
|
||||
ListenableFuture<? extends Set<? extends SecurityGroup>> listSecurityGroups();
|
||||
|
||||
/**
|
||||
* @see SecurityGroupApi#getSecurityGroup
|
||||
|
@ -83,7 +83,7 @@ public interface SecurityGroupAsyncApi {
|
|||
@SelectJson("security_group")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<SecurityGroup> getSecurityGroup(@PathParam("id") String id);
|
||||
ListenableFuture<? extends SecurityGroup> getSecurityGroup(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see SecurityGroupApi#createSecurityGroupWithNameAndDescription
|
||||
|
@ -95,7 +95,7 @@ public interface SecurityGroupAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Payload("%7B\"security_group\":%7B\"name\":\"{name}\",\"description\":\"{description}\"%7D%7D")
|
||||
ListenableFuture<SecurityGroup> createSecurityGroupWithNameAndDescription(@PayloadParam("name") String name,
|
||||
ListenableFuture<? extends SecurityGroup> createSecurityGroupWithNameAndDescription(@PayloadParam("name") String name,
|
||||
@PayloadParam("description") String description);
|
||||
|
||||
/**
|
||||
|
@ -117,7 +117,7 @@ public interface SecurityGroupAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@MapBinder(BindSecurityGroupRuleToJsonPayload.class)
|
||||
ListenableFuture<SecurityGroupRule> createSecurityGroupRuleAllowingCidrBlock(
|
||||
ListenableFuture<? extends SecurityGroupRule> createSecurityGroupRuleAllowingCidrBlock(
|
||||
@PayloadParam("parent_group_id") String parent_group_id, Ingress ip_protocol,
|
||||
@PayloadParam("cidr") String cidr);
|
||||
|
||||
|
@ -131,7 +131,7 @@ public interface SecurityGroupAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@MapBinder(BindSecurityGroupRuleToJsonPayload.class)
|
||||
ListenableFuture<SecurityGroupRule> createSecurityGroupRuleAllowingSecurityGroupId(
|
||||
ListenableFuture<? extends SecurityGroupRule> createSecurityGroupRuleAllowingSecurityGroupId(
|
||||
@PayloadParam("parent_group_id") String parent_group_id, Ingress ip_protocol,
|
||||
@PayloadParam("group_id") String group_id);
|
||||
|
||||
|
|
|
@ -57,6 +57,6 @@ public interface ServerWithSecurityGroupsAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/os-create-server-ext/{id}")
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<ServerWithSecurityGroups> getServer(@PathParam("id") String id);
|
||||
ListenableFuture<? extends ServerWithSecurityGroups> getServer(@PathParam("id") String id);
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public interface SimpleTenantUsageApi {
|
|||
*
|
||||
* @return the set of TenantUsage reports
|
||||
*/
|
||||
Set<SimpleTenantUsage> listTenantUsages();
|
||||
Set<? extends SimpleTenantUsage> listTenantUsages();
|
||||
|
||||
/**
|
||||
* Retrieve tenant_usage for a specified tenant
|
||||
|
|
|
@ -62,7 +62,7 @@ public interface SimpleTenantUsageAsyncApi {
|
|||
@SelectJson("tenant_usages")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<SimpleTenantUsage>> listTenantUsages();
|
||||
ListenableFuture<? extends Set<? extends SimpleTenantUsage>> listTenantUsages();
|
||||
|
||||
/**
|
||||
* @see SimpleTenantUsageApi#getTenantUsage(String)
|
||||
|
@ -72,6 +72,6 @@ public interface SimpleTenantUsageAsyncApi {
|
|||
@SelectJson("tenant_usage")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<SimpleTenantUsage> getTenantUsage(@PathParam("id") String tenantId);
|
||||
ListenableFuture<? extends SimpleTenantUsage> getTenantUsage(@PathParam("id") String tenantId);
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,6 @@ public interface VirtualInterfaceApi {
|
|||
*
|
||||
* @return the list of snapshots
|
||||
*/
|
||||
Set<VirtualInterface> listVirtualInterfacesForServer(String serverId);
|
||||
Set<? extends VirtualInterface> listVirtualInterfacesForServer(String serverId);
|
||||
|
||||
}
|
||||
|
|
|
@ -56,5 +56,5 @@ public interface VirtualInterfaceAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/servers/{server_id}/os-virtual-interfaces")
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<VirtualInterface>> listVirtualInterfacesForServer(@PathParam("server_id") String serverId);
|
||||
ListenableFuture<? extends Set<? extends VirtualInterface>> listVirtualInterfacesForServer(@PathParam("server_id") String serverId);
|
||||
}
|
||||
|
|
|
@ -45,14 +45,14 @@ public interface VolumeApi {
|
|||
*
|
||||
* @return the list of snapshots
|
||||
*/
|
||||
Set<Volume> listVolumes();
|
||||
Set<? extends Volume> listVolumes();
|
||||
|
||||
/**
|
||||
* Returns a detailed list of volumes.
|
||||
*
|
||||
* @return the list of volumes.
|
||||
*/
|
||||
Set<Volume> listVolumesInDetail();
|
||||
Set<? extends Volume> listVolumesInDetail();
|
||||
|
||||
/**
|
||||
* Return data about the given volume.
|
||||
|
@ -80,7 +80,7 @@ public interface VolumeApi {
|
|||
*
|
||||
* @return all Floating IPs
|
||||
*/
|
||||
Set<VolumeAttachment> listAttachmentsOnServer(String serverId);
|
||||
Set<? extends VolumeAttachment> listAttachmentsOnServer(String serverId);
|
||||
|
||||
/**
|
||||
* Get a specific attached volume.
|
||||
|
@ -108,14 +108,14 @@ public interface VolumeApi {
|
|||
*
|
||||
* @return the list of snapshots
|
||||
*/
|
||||
Set<VolumeSnapshot> listSnapshots();
|
||||
Set<? extends VolumeSnapshot> listSnapshots();
|
||||
|
||||
/**
|
||||
* Returns a summary list of snapshots.
|
||||
*
|
||||
* @return the list of snapshots
|
||||
*/
|
||||
Set<VolumeSnapshot> listSnapshotsInDetail();
|
||||
Set<? extends VolumeSnapshot> listSnapshotsInDetail();
|
||||
|
||||
/**
|
||||
* Return data about the given snapshot.
|
||||
|
|
|
@ -71,7 +71,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("volumes")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<Volume>> listVolumes();
|
||||
ListenableFuture<? extends Set<? extends Volume>> listVolumes();
|
||||
|
||||
/**
|
||||
* Returns a detailed list of volumes.
|
||||
|
@ -83,7 +83,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("volumes")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<Volume>> listVolumesInDetail();
|
||||
ListenableFuture<? extends Set<? extends Volume>> listVolumesInDetail();
|
||||
|
||||
/**
|
||||
* Return data about the given volume.
|
||||
|
@ -95,7 +95,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("volume")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<Volume> getVolume(@PathParam("id") String volumeId);
|
||||
ListenableFuture<? extends Volume> getVolume(@PathParam("id") String volumeId);
|
||||
|
||||
/**
|
||||
* Creates a new volume
|
||||
|
@ -108,7 +108,7 @@ public interface VolumeAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@MapBinder(CreateVolumeOptions.class)
|
||||
ListenableFuture<Volume> createVolume(@PayloadParam("size") int sizeGB, CreateVolumeOptions... options);
|
||||
ListenableFuture<? extends Volume> createVolume(@PayloadParam("size") int sizeGB, CreateVolumeOptions... options);
|
||||
|
||||
/**
|
||||
* Delete a volume.
|
||||
|
@ -131,7 +131,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("volumeAttachments")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<VolumeAttachment>> listAttachmentsOnServer(@PathParam("server_id") String serverId);
|
||||
ListenableFuture<? extends Set<? extends VolumeAttachment>> listAttachmentsOnServer(@PathParam("server_id") String serverId);
|
||||
|
||||
/**
|
||||
* Get a specific attached volume.
|
||||
|
@ -143,7 +143,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("volumeAttachment")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<VolumeAttachment> getAttachmentForVolumeOnServer(@PathParam("id") String volumeId,
|
||||
ListenableFuture<? extends VolumeAttachment> getAttachmentForVolumeOnServer(@PathParam("id") String volumeId,
|
||||
@PathParam("server_id") String serverId);
|
||||
|
||||
/**
|
||||
|
@ -157,7 +157,7 @@ public interface VolumeAsyncApi {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("volumeAttachment")
|
||||
ListenableFuture<VolumeAttachment> attachVolumeToServerAsDevice(@PayloadParam("volumeId") String volumeId,
|
||||
ListenableFuture<? extends VolumeAttachment> attachVolumeToServerAsDevice(@PayloadParam("volumeId") String volumeId,
|
||||
@PathParam("server_id") String serverId, @PayloadParam("device") String device);
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("snapshots")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<VolumeSnapshot>> listSnapshots();
|
||||
ListenableFuture<? extends Set<? extends VolumeSnapshot>> listSnapshots();
|
||||
|
||||
/**
|
||||
* Returns a summary list of snapshots.
|
||||
|
@ -193,7 +193,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("snapshots")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<VolumeSnapshot>> listSnapshotsInDetail();
|
||||
ListenableFuture<? extends Set<? extends VolumeSnapshot>> listSnapshotsInDetail();
|
||||
|
||||
/**
|
||||
* Return data about the given snapshot.
|
||||
|
@ -205,7 +205,7 @@ public interface VolumeAsyncApi {
|
|||
@SelectJson("snapshot")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<VolumeSnapshot> getSnapshot(@PathParam("id") String snapshotId);
|
||||
ListenableFuture<? extends VolumeSnapshot> getSnapshot(@PathParam("id") String snapshotId);
|
||||
|
||||
/**
|
||||
* Creates a new Snapshot
|
||||
|
@ -218,7 +218,7 @@ public interface VolumeAsyncApi {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@MapBinder(CreateVolumeSnapshotOptions.class)
|
||||
ListenableFuture<VolumeSnapshot> createSnapshot(@PayloadParam("volume_id") String volumeId, CreateVolumeSnapshotOptions... options);
|
||||
ListenableFuture<? extends VolumeSnapshot> createSnapshot(@PayloadParam("volume_id") String volumeId, CreateVolumeSnapshotOptions... options);
|
||||
|
||||
/**
|
||||
* Delete a snapshot.
|
||||
|
|
|
@ -47,7 +47,7 @@ public interface VolumeTypeApi {
|
|||
/**
|
||||
* @return set of all volume types
|
||||
*/
|
||||
Set<VolumeType> listVolumeTypes();
|
||||
Set<? extends VolumeType> listVolumeTypes();
|
||||
|
||||
/**
|
||||
* @param id the id of the volume type to retrieve
|
||||
|
|
|
@ -72,7 +72,7 @@ public interface VolumeTypeAsyncApi {
|
|||
@GET
|
||||
@SelectJson("volume_types")
|
||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||
ListenableFuture<Set<VolumeType>> listVolumeTypes();
|
||||
ListenableFuture<? extends Set<? extends VolumeType>> listVolumeTypes();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -82,7 +82,7 @@ public interface VolumeTypeAsyncApi {
|
|||
@Path("/{id}")
|
||||
@SelectJson("volume_type")
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<VolumeType> getVolumeType(@PathParam("id") String id);
|
||||
ListenableFuture<? extends VolumeType> getVolumeType(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see VolumeTypeApi#createVolumeType
|
||||
|
@ -91,7 +91,7 @@ public interface VolumeTypeAsyncApi {
|
|||
@SelectJson("volume_type")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@WrapWith("volume_type")
|
||||
ListenableFuture<VolumeType> createVolumeType(@PayloadParam("name") String name, CreateVolumeTypeOptions... options);
|
||||
ListenableFuture<? extends VolumeType> createVolumeType(@PayloadParam("name") String name, CreateVolumeTypeOptions... options);
|
||||
|
||||
/**
|
||||
* @see VolumeTypeApi#deleteVolumeType
|
||||
|
|
|
@ -25,6 +25,8 @@ import static org.easymock.EasyMock.verify;
|
|||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.AssertJUnit.assertFalse;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.openstack.nova.v2_0.NovaApi;
|
||||
import org.jclouds.openstack.nova.v2_0.domain.FloatingIP;
|
||||
import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndId;
|
||||
|
@ -47,7 +49,7 @@ public class LoadFloatingIpsForInstanceTest {
|
|||
FloatingIP testIp = FloatingIP.builder().id("1").ip("1.1.1.1").fixedIp("10.1.1.1").instanceId("i-blah").build();
|
||||
|
||||
expect(api.getFloatingIPExtensionForZone("Zone")).andReturn((Optional) Optional.of(ipApi)).atLeastOnce();
|
||||
expect(ipApi.listFloatingIPs()).andReturn(ImmutableSet.<FloatingIP>of(testIp)).atLeastOnce();
|
||||
expect(ipApi.listFloatingIPs()).andReturn((Set) ImmutableSet.<FloatingIP>of(testIp)).atLeastOnce();
|
||||
|
||||
replay(api);
|
||||
replay(ipApi);
|
||||
|
@ -67,7 +69,7 @@ public class LoadFloatingIpsForInstanceTest {
|
|||
|
||||
expect(api.getFloatingIPExtensionForZone("Zone")).andReturn((Optional) Optional.of(ipApi)).atLeastOnce();
|
||||
|
||||
expect(ipApi.listFloatingIPs()).andReturn(ImmutableSet.<FloatingIP>of()).atLeastOnce();
|
||||
expect(ipApi.listFloatingIPs()).andReturn((Set) ImmutableSet.<FloatingIP>of()).atLeastOnce();
|
||||
|
||||
replay(api);
|
||||
replay(ipApi);
|
||||
|
@ -89,7 +91,7 @@ public class LoadFloatingIpsForInstanceTest {
|
|||
expect(api.getFloatingIPExtensionForZone("Zone")).andReturn((Optional) Optional.of(ipApi)).atLeastOnce();
|
||||
|
||||
expect(ipApi.listFloatingIPs()).andReturn(
|
||||
ImmutableSet.<FloatingIP>of(FloatingIP.builder().id("1").ip("1.1.1.1").build()))
|
||||
(Set) ImmutableSet.<FloatingIP>of(FloatingIP.builder().id("1").ip("1.1.1.1").build()))
|
||||
.atLeastOnce();
|
||||
|
||||
replay(api);
|
||||
|
|
|
@ -52,7 +52,7 @@ public class FloatingIPApiLiveTest extends BaseNovaApiLiveTest {
|
|||
if (!apiOption.isPresent())
|
||||
continue;
|
||||
FloatingIPApi api = apiOption.get();
|
||||
Set<FloatingIP> response = api.listFloatingIPs();
|
||||
Set<? extends FloatingIP> response = api.listFloatingIPs();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
for (FloatingIP ip : response) {
|
||||
|
@ -77,7 +77,7 @@ public class FloatingIPApiLiveTest extends BaseNovaApiLiveTest {
|
|||
FloatingIP floatingIP = api.allocate();
|
||||
assertNotNull(floatingIP);
|
||||
|
||||
Set<FloatingIP> response = api.listFloatingIPs();
|
||||
Set<? extends FloatingIP> response = api.listFloatingIPs();
|
||||
boolean ipInSet = false;
|
||||
for (FloatingIP ip : response) {
|
||||
if (ip.getId().equals(floatingIP.getId()))
|
||||
|
|
|
@ -59,7 +59,7 @@ public class HostAdministrationApiExpectTest extends BaseNovaApiExpectTest {
|
|||
|
||||
Host expected = Host.builder().name("ubuntu").service("compute").build();
|
||||
|
||||
Set<Host> result = api.listHosts();
|
||||
Set<? extends Host> result = api.listHosts();
|
||||
Host host = Iterables.getOnlyElement(result);
|
||||
assertEquals(host.getName(), "ubuntu");
|
||||
assertEquals(host.getService(), "compute");
|
||||
|
|
|
@ -65,7 +65,7 @@ public class HostAdministrationApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListAndGet() throws Exception {
|
||||
if (optApi.isPresent()) {
|
||||
HostAdministrationApi api = optApi.get();
|
||||
Set<Host> hosts = api.listHosts();
|
||||
Set<? extends Host> hosts = api.listHosts();
|
||||
assertNotNull(hosts);
|
||||
for (Host host : hosts) {
|
||||
for (HostResourceUsage usage : api.getHostResourceUsage(host.getName())) {
|
||||
|
|
|
@ -78,7 +78,7 @@ public class HostAggregateApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListAndGetAggregate() {
|
||||
if (apiOption.isPresent()) {
|
||||
HostAggregateApi api = apiOption.get();
|
||||
Set<HostAggregate> aggregates = api.listAggregates();
|
||||
Set<? extends HostAggregate> aggregates = api.listAggregates();
|
||||
for (HostAggregate aggregate : aggregates) {
|
||||
assertNotNull(aggregate.getId());
|
||||
assertNotNull(aggregate.getName());
|
||||
|
|
|
@ -55,6 +55,7 @@ public class KeyPairApiExpectTest extends BaseNovaApiExpectTest {
|
|||
|
||||
assertEquals(apiWhenServersExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
|
||||
|
||||
// NOTE this required a change to the KeyPair domain object toString method
|
||||
assertEquals(apiWhenServersExist.getKeyPairExtensionForZone("az-1.region-a.geo-1").get().listKeyPairs().toString(),
|
||||
new ParseKeyPairListTest().expected().toString());
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class KeyPairApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void testListKeyPairs() throws Exception {
|
||||
for (String zoneId : novaContext.getApi().getConfiguredZones()) {
|
||||
KeyPairApi api = novaContext.getApi().getKeyPairExtensionForZone(zoneId).get();
|
||||
Set<Map<String, KeyPair>> keyPairsList = api.listKeyPairs();
|
||||
Set<? extends Map<String, ? extends KeyPair>> keyPairsList = api.listKeyPairs();
|
||||
assertNotNull(keyPairsList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SecurityGroupApiLiveTest extends BaseNovaApiLiveTest {
|
|||
public void listSecurityGroups() throws Exception {
|
||||
for (String zoneId : novaContext.getApi().getConfiguredZones()) {
|
||||
SecurityGroupApi api = novaContext.getApi().getSecurityGroupExtensionForZone(zoneId).get();
|
||||
Set<SecurityGroup> securityGroupsList = api.listSecurityGroups();
|
||||
Set<? extends SecurityGroup> securityGroupsList = api.listSecurityGroups();
|
||||
assertNotNull(securityGroupsList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class SimpleTenantUsageApiExpectTest extends BaseNovaApiExpectTest {
|
|||
.payload(payloadFromResource("/simple_tenant_usages.json")).build())
|
||||
.getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<SimpleTenantUsage> results = api.listTenantUsages();
|
||||
Set<? extends SimpleTenantUsage> results = api.listTenantUsages();
|
||||
|
||||
SimpleTenantUsage usage = Iterables.getOnlyElement(results);
|
||||
assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
|
||||
|
|
|
@ -41,7 +41,7 @@ public class SimpleTenantUsageApiLiveTest extends BaseNovaApiLiveTest {
|
|||
Optional<? extends SimpleTenantUsageApi> optApi = novaContext.getApi().getSimpleTenantUsageExtensionForZone(zoneId);
|
||||
if (optApi.isPresent() && identity.endsWith(":admin")) {
|
||||
SimpleTenantUsageApi api = optApi.get();
|
||||
Set<SimpleTenantUsage> usages = api.listTenantUsages();
|
||||
Set<? extends SimpleTenantUsage> usages = api.listTenantUsages();
|
||||
assertNotNull(usages);
|
||||
for (SimpleTenantUsage usage : usages) {
|
||||
SimpleTenantUsage details = api.getTenantUsage(usage.getTenantId());
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VirtualInterfaceApiLiveTest extends BaseNovaApiLiveTest {
|
|||
Server testServer = null;
|
||||
try {
|
||||
testServer = createServerInZone(zone);
|
||||
Set<VirtualInterface> results = apiOption.get().listVirtualInterfacesForServer(testServer.getId());
|
||||
Set<? extends VirtualInterface> results = apiOption.get().listVirtualInterfacesForServer(testServer.getId());
|
||||
for (VirtualInterface vif : results) {
|
||||
assertNotNull(vif.getId());
|
||||
assertNotNull(vif.getMacAddress());
|
||||
|
|
|
@ -62,7 +62,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_list.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<Volume> volumes = api.listVolumes();
|
||||
Set<? extends Volume> volumes = api.listVolumes();
|
||||
assertEquals(volumes, ImmutableSet.of(testVolume()));
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<Volume> volumes = api.listVolumes();
|
||||
Set<? extends Volume> volumes = api.listVolumes();
|
||||
assertTrue(volumes.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_list_detail.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<Volume> volumes = api.listVolumesInDetail();
|
||||
Set<? extends Volume> volumes = api.listVolumesInDetail();
|
||||
assertEquals(volumes, ImmutableSet.of(testVolume()));
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<Volume> volumes = api.listVolumesInDetail();
|
||||
Set<? extends Volume> volumes = api.listVolumesInDetail();
|
||||
assertTrue(volumes.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_list.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1");
|
||||
Set<? extends VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1");
|
||||
assertEquals(attachments, ImmutableSet.of(testAttachment()));
|
||||
// double-check individual fields
|
||||
VolumeAttachment attachment = Iterables.getOnlyElement(attachments);
|
||||
|
@ -312,7 +312,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<VolumeSnapshot> snapshots = api.listSnapshots();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshots();
|
||||
assertEquals(snapshots, ImmutableSet.of(testSnapshot()));
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<VolumeSnapshot> snapshots = api.listSnapshots();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshots();
|
||||
assertTrue(snapshots.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list_detail.json")).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<VolumeSnapshot> snapshots = api.listSnapshotsInDetail();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail();
|
||||
assertEquals(snapshots, ImmutableSet.of(testSnapshot()));
|
||||
|
||||
// double-check individual fields
|
||||
|
@ -385,7 +385,7 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(404).build()
|
||||
).getVolumeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<VolumeSnapshot> snapshots = api.listSnapshotsInDetail();
|
||||
Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail();
|
||||
assertTrue(snapshots.isEmpty());
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateVolume")
|
||||
public void testListVolumes() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<Volume> volumes = volumeOption.get().listVolumes();
|
||||
Set<? extends Volume> volumes = volumeOption.get().listVolumes();
|
||||
assertNotNull(volumes);
|
||||
boolean foundIt = false;
|
||||
for (Volume vol : volumes) {
|
||||
|
@ -125,7 +125,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateVolume")
|
||||
public void testListVolumesInDetail() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<Volume> volumes = volumeOption.get().listVolumesInDetail();
|
||||
Set<? extends Volume> volumes = volumeOption.get().listVolumesInDetail();
|
||||
assertNotNull(volumes);
|
||||
boolean foundIt = false;
|
||||
for (Volume vol : volumes) {
|
||||
|
@ -174,7 +174,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateSnapshot")
|
||||
public void testListSnapshots() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<VolumeSnapshot> snapshots = volumeOption.get().listSnapshots();
|
||||
Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshots();
|
||||
assertNotNull(snapshots);
|
||||
boolean foundIt = false;
|
||||
for (VolumeSnapshot snap : snapshots) {
|
||||
|
@ -193,7 +193,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateSnapshot")
|
||||
public void testListSnapshotsInDetail() {
|
||||
if (volumeOption.isPresent()) {
|
||||
Set<VolumeSnapshot> snapshots = volumeOption.get().listSnapshotsInDetail();
|
||||
Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshotsInDetail();
|
||||
assertNotNull(snapshots);
|
||||
boolean foundIt = false;
|
||||
for (VolumeSnapshot snap : snapshots) {
|
||||
|
@ -225,7 +225,7 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
try {
|
||||
final String serverId = server_id = createServerInZone(zone).getId();
|
||||
|
||||
Set<VolumeAttachment> attachments = volumeOption.get().listAttachmentsOnServer(serverId);
|
||||
Set<? extends VolumeAttachment> attachments = volumeOption.get().listAttachmentsOnServer(serverId);
|
||||
assertNotNull(attachments);
|
||||
final int before = attachments.size();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class VolumeTypeApiExpectTest extends BaseNovaApiExpectTest {
|
|||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_type_list.json")).build()
|
||||
).getVolumeTypeExtensionForZone("az-1.region-a.geo-1").get();
|
||||
|
||||
Set<VolumeType> types = api.listVolumeTypes();
|
||||
Set<? extends VolumeType> types = api.listVolumeTypes();
|
||||
assertEquals(types, ImmutableSet.of(testVolumeType()));
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ public class VolumeTypeApiLiveTest extends BaseNovaApiLiveTest {
|
|||
@Test(dependsOnMethods = "testCreateVolumeType")
|
||||
public void testListVolumeTypes() {
|
||||
if (volumeTypeOption.isPresent()) {
|
||||
Set<VolumeType> volumeTypes = volumeTypeOption.get().listVolumeTypes();
|
||||
Set<? extends VolumeType> volumeTypes = volumeTypeOption.get().listVolumeTypes();
|
||||
assertNotNull(volumeTypes);
|
||||
boolean foundIt = false;
|
||||
for (VolumeType vt : volumeTypes) {
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package org.jclouds.openstack.nova.v2_0.parse;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import org.jclouds.rest.annotations.SelectJson;
|
|||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class ParseKeyPairListTest extends BaseItemParserTest<Set<Map<String, Key
|
|||
@SelectJson("keypairs")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public Set<Map<String, KeyPair>> expected() {
|
||||
Map<String, KeyPair> kp1 = new HashMap<String, KeyPair>();
|
||||
Map<String, KeyPair> kp1 = Maps.newHashMap();
|
||||
kp1.put(
|
||||
"keypair",
|
||||
KeyPair
|
||||
|
@ -60,7 +60,7 @@ public class ParseKeyPairListTest extends BaseItemParserTest<Set<Map<String, Key
|
|||
.publicKey(
|
||||
"ssh-rsa AAAXB3NzaC1yc2EAAAADAQABAAAAgQCy9EC3O7Ff80vPEfAHDQob61PGwcpYc5KE7tEZnZhrB9n0NyHPRm0E0M+ls3fcTa04HDi+R0DzmRwoyhHQJyI658v8kWZZcuvFjKCcsgsSh/dzdX0xTreLIzSOzt5U7RnZYfshP5cmxtF99yrEY3M/swdin0L+fXsTSkR1B42STQ== nova@nv-aw2az1-api0001")
|
||||
.name("default").fingerprint("ab:0c:f4:f3:54:c0:5d:3f:ed:62:ad:d3:94:7c:79:7c").build());
|
||||
Map<String, KeyPair> kp2 = new HashMap<String, KeyPair>();
|
||||
Map<String, KeyPair> kp2 = Maps.newHashMap();
|
||||
kp2.put(
|
||||
"keypair",
|
||||
KeyPair
|
||||
|
|
Loading…
Reference in New Issue