mirror of https://github.com/apache/jclouds.git
Merge branch 'master' of git@github.com:jclouds/jclouds
* 'master' of git@github.com:jclouds/jclouds: for amazon web services, changed the Region to String format (from enum). clojure code for aws needs verification
This commit is contained in:
commit
139b5fe312
|
@ -53,13 +53,13 @@
|
|||
([v] (get-region v nil))
|
||||
([v default-region]
|
||||
(cond
|
||||
(keyword? v) (Region/fromValue (name v))
|
||||
(keyword? v) (name v)
|
||||
(instance? Region v) v
|
||||
(instance? NodeMetadata v) (let [zone (.getLocationId v)]
|
||||
; no easier way to go from zone -> region?
|
||||
(Region/fromValue (if (> (.indexOf zone "-") -1)
|
||||
(if (> (.indexOf zone "-") -1)
|
||||
(subs zone 0 (-> zone count dec))
|
||||
zone)))
|
||||
zone))
|
||||
:else default-region)))
|
||||
|
||||
(defn get-volume-id
|
||||
|
|
|
@ -31,12 +31,7 @@ import com.google.common.base.CaseFormat;
|
|||
* "http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?LocationSelection.html" />
|
||||
*
|
||||
*/
|
||||
public enum Region {
|
||||
|
||||
/**
|
||||
* Region returned is unknown.
|
||||
*/
|
||||
UNKNOWN,
|
||||
public class Region {
|
||||
|
||||
/**
|
||||
* EU (Ireland)
|
||||
|
@ -46,7 +41,7 @@ public enum Region {
|
|||
* In Amazon S3, the EU (Ireland) Region provides read-after-write consistency for PUTS of new
|
||||
* objects in your Amazon S3 bucket and eventual consistency for overwrite PUTS and DELETES.
|
||||
*/
|
||||
EU_WEST_1,
|
||||
public static final String EU_WEST_1 = "eu-west-1";
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -60,12 +55,12 @@ public enum Region {
|
|||
* with the lowest latency. To use this region, do not set the LocationConstraint bucket
|
||||
* parameter. The US Standard Region provides eventual consistency for all requests.
|
||||
*/
|
||||
US_STANDARD,
|
||||
public static final String US_STANDARD = "us-standard";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
US_EAST_1,
|
||||
public static final String US_EAST_1 = "us-east-1";
|
||||
|
||||
/**
|
||||
* US-West (Northern California) <h3>S3</h3> Uses Amazon S3 servers in Northern California
|
||||
|
@ -78,21 +73,11 @@ public enum Region {
|
|||
* for PUTS of new objects in your Amazon S3 bucket and eventual consistency for overwrite PUTS
|
||||
* and DELETES.
|
||||
*/
|
||||
US_WEST_1,
|
||||
|
||||
AP_SOUTHEAST_1;
|
||||
public static final String US_WEST_1 = "us-west-1";
|
||||
|
||||
public String value() {
|
||||
return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value();
|
||||
}
|
||||
|
||||
public static Region fromValue(String region) {
|
||||
return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(region,
|
||||
"region")));
|
||||
}
|
||||
/**
|
||||
* Region in Singapore, launched April 28, 2010.
|
||||
* This region improves latency for Asia-based users
|
||||
*/
|
||||
public static final String AP_SOUTHEAST_1 = "ap-southeast-1";
|
||||
}
|
|
@ -86,7 +86,7 @@ public class EC2ComputeService extends BaseComputeService {
|
|||
this.instanceStateTerminated = instanceStateTerminated;
|
||||
}
|
||||
|
||||
private void deleteSecurityGroup(Region region, String tag) {
|
||||
private void deleteSecurityGroup(String region, String tag) {
|
||||
if (ec2Client.getSecurityGroupServices().describeSecurityGroupsInRegion(region, tag).size() > 0) {
|
||||
logger.debug(">> deleting securityGroup(%s)", tag);
|
||||
ec2Client.getSecurityGroupServices().deleteSecurityGroupInRegion(region, tag);
|
||||
|
@ -96,7 +96,7 @@ public class EC2ComputeService extends BaseComputeService {
|
|||
}
|
||||
}
|
||||
|
||||
private void deleteKeyPair(Region region, String tag) {
|
||||
private void deleteKeyPair(String region, String tag) {
|
||||
for (KeyPair keyPair : ec2Client.getKeyPairServices().describeKeyPairsInRegion(region)) {
|
||||
if (keyPair.getKeyName().matches(tag + "-[0-9]+")) {
|
||||
logger.debug(">> deleting keyPair(%s)", tag);
|
||||
|
@ -119,7 +119,7 @@ public class EC2ComputeService extends BaseComputeService {
|
|||
}
|
||||
});
|
||||
if (Iterables.size(nodes) > 0) {
|
||||
Region region = getRegionFromNodeOrDefault.apply(Iterables.get(nodes, 0));
|
||||
String region = getRegionFromNodeOrDefault.apply(Iterables.get(nodes, 0));
|
||||
deleteKeyPair(region, tag);
|
||||
deleteSecurityGroup(region, tag);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
@Override
|
||||
public Iterable<? extends ComputeMetadata> execute(GetNodesOptions options) {
|
||||
Set<NodeMetadata> nodes = Sets.newHashSet();
|
||||
for (Region region : ImmutableSet.of(Region.US_EAST_1, Region.US_WEST_1, Region.EU_WEST_1)) {
|
||||
for (String region : ImmutableSet.of(Region.US_EAST_1, Region.US_WEST_1, Region.EU_WEST_1)) {
|
||||
Iterables.addAll(nodes, Iterables.transform(Iterables.concat(client
|
||||
.describeInstancesInRegion(region)), runningInstanceToNodeMetadata));
|
||||
}
|
||||
|
@ -144,11 +144,11 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
}
|
||||
|
||||
@Singleton
|
||||
public static class GetRegionFromNodeOrDefault implements Function<ComputeMetadata, Region> {
|
||||
public Region apply(ComputeMetadata node) {
|
||||
public static class GetRegionFromNodeOrDefault implements Function<ComputeMetadata, String> {
|
||||
public String apply(ComputeMetadata node) {
|
||||
Location location = node.getLocation();
|
||||
Region region = location.getScope() == LocationScope.REGION ? Region.fromValue(location
|
||||
.getId()) : Region.fromValue(location.getParent());
|
||||
String region = location.getScope() == LocationScope.REGION ? location
|
||||
.getId() : location.getParent();
|
||||
return region;
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
|
||||
@Override
|
||||
public NodeMetadata execute(ComputeMetadata node) {
|
||||
Region region = getRegionFromNodeOrDefault.apply(node);
|
||||
String region = getRegionFromNodeOrDefault.apply(node);
|
||||
RunningInstance runningInstance = Iterables.getOnlyElement(getAllRunningInstancesInRegion(
|
||||
client, region, node.getId()));
|
||||
return runningInstanceToNodeMetadata.apply(runningInstance);
|
||||
|
@ -180,7 +180,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
}
|
||||
|
||||
public static Iterable<RunningInstance> getAllRunningInstancesInRegion(InstanceClient client,
|
||||
Region region, String id) {
|
||||
String region, String id) {
|
||||
return Iterables.concat(client.describeInstancesInRegion(region, id));
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
|
||||
@Override
|
||||
public boolean execute(ComputeMetadata node) {
|
||||
Region region = getRegionFromNodeOrDefault.apply(node);
|
||||
String region = getRegionFromNodeOrDefault.apply(node);
|
||||
client.rebootInstancesInRegion(region, node.getId());
|
||||
return true;
|
||||
}
|
||||
|
@ -257,23 +257,23 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
Map<String, ? extends Location> provideLocations(Map<AvailabilityZone, Region> map) {
|
||||
Map<String, ? extends Location> provideLocations(Map<AvailabilityZone, String> availabilityZoneToRegionMap) {
|
||||
Map<String, Location> locations = Maps.newLinkedHashMap();
|
||||
for (AvailabilityZone zone : map.keySet()) {
|
||||
for (AvailabilityZone zone : availabilityZoneToRegionMap.keySet()) {
|
||||
locations.put(zone.toString(), new LocationImpl(LocationScope.ZONE, zone.toString(), zone
|
||||
.toString(), map.get(zone).toString()));
|
||||
.toString(), availabilityZoneToRegionMap.get(zone)));
|
||||
}
|
||||
for (Region region : map.values()) {
|
||||
locations.put(region.toString(), new LocationImpl(LocationScope.REGION, region.toString(),
|
||||
region.toString(), null));
|
||||
for (String region : availabilityZoneToRegionMap.values()) {
|
||||
locations.put(region, new LocationImpl(LocationScope.REGION, region,
|
||||
region, null));
|
||||
}
|
||||
return locations;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Location getDefaultLocation(@EC2 Region region, Map<String, ? extends Location> map) {
|
||||
return map.get(region.toString());
|
||||
Location getDefaultLocation(@EC2 String region, Map<String, ? extends Location> map) {
|
||||
return map.get(region);
|
||||
}
|
||||
|
||||
private static class LogHolder {
|
||||
|
@ -292,14 +292,14 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
protected Map<String, ? extends Image> provideImages(final EC2Client sync,
|
||||
@EC2 Map<Region, URI> regionMap, LogHolder holder,
|
||||
@EC2 Map<String, URI> regionMap, LogHolder holder,
|
||||
Function<ComputeMetadata, String> indexer,
|
||||
@Named(PROPERTY_EC2_AMI_OWNERS) String[] amiOwners, ImageParser parser)
|
||||
throws InterruptedException, ExecutionException, TimeoutException {
|
||||
final Set<Image> images = Sets.newHashSet();
|
||||
holder.logger.debug(">> providing images");
|
||||
|
||||
for (final Region region : regionMap.keySet()) {
|
||||
for (final String region : regionMap.keySet()) {
|
||||
for (final org.jclouds.aws.ec2.domain.Image from : sync.getAMIServices()
|
||||
.describeImagesInRegion(region, ownedBy(amiOwners))) {
|
||||
Image image = parser.apply(from);
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.jclouds.aws.ec2.compute.domain;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
|
@ -28,7 +26,7 @@ import org.jclouds.aws.domain.Region;
|
|||
public class PortsRegionTag extends RegionTag {
|
||||
private final int[] ports;
|
||||
|
||||
public PortsRegionTag(Region region, String tag, int[] ports) {
|
||||
public PortsRegionTag(String region, String tag, int[] ports) {
|
||||
super(region, tag);
|
||||
this.ports = ports;
|
||||
}
|
||||
|
|
|
@ -18,17 +18,15 @@
|
|||
*/
|
||||
package org.jclouds.aws.ec2.compute.domain;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class RegionTag {
|
||||
protected final Region region;
|
||||
protected final String region;
|
||||
protected final String tag;
|
||||
|
||||
public RegionTag(Region region, String tag) {
|
||||
public RegionTag(String region, String tag) {
|
||||
this.region = region;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
@ -64,7 +62,7 @@ public class RegionTag {
|
|||
return true;
|
||||
}
|
||||
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class CreateNewKeyPair implements Function<RegionTag, KeyPair> {
|
|||
return createNewKeyPairInRegion(from.getRegion(), from.getTag());
|
||||
}
|
||||
|
||||
private KeyPair createNewKeyPairInRegion(Region region, String tag) {
|
||||
private KeyPair createNewKeyPairInRegion(String region, String tag) {
|
||||
checkNotNull(region, "region");
|
||||
checkNotNull(tag, "tag");
|
||||
logger.debug(">> creating keyPair region(%s) tag(%s)", region, tag);
|
||||
|
|
|
@ -37,7 +37,7 @@ public class CreateSecurityGroupIfNeeded implements Function<PortsRegionTag, Str
|
|||
return from.getTag();
|
||||
}
|
||||
|
||||
private void createSecurityGroupInRegion(Region region, String name, int... ports) {
|
||||
private void createSecurityGroupInRegion(String region, String name, int... ports) {
|
||||
checkNotNull(region, "region");
|
||||
checkNotNull(name, "name");
|
||||
logger.debug(">> creating securityGroup region(%s) name(%s)", region, name);
|
||||
|
|
|
@ -105,7 +105,7 @@ public class ImageParser implements Function<org.jclouds.aws.ec2.domain.Image, I
|
|||
return new ImageImpl(
|
||||
from.getId(),
|
||||
name,
|
||||
locations.get(from.getRegion().toString()),
|
||||
locations.get(from.getRegion()),
|
||||
null,
|
||||
ImmutableMap.<String, String> of("owner", from.getImageOwnerId()),
|
||||
description,
|
||||
|
|
|
@ -67,7 +67,7 @@ public class EC2DestroyNodeStrategy implements DestroyNodeStrategy {
|
|||
public boolean execute(ComputeMetadata metadata) {
|
||||
NodeMetadata node = metadata instanceof NodeMetadata ? NodeMetadata.class.cast(metadata)
|
||||
: getNodeMetadataStrategy.execute(metadata);
|
||||
Region region = getRegionFromNodeOrDefault.apply(node);
|
||||
String region = getRegionFromNodeOrDefault.apply(node);
|
||||
|
||||
ec2Client.getInstanceServices().terminateInstancesInRegion(region, node.getId());
|
||||
return instanceStateTerminated.apply(Iterables.getOnlyElement(Iterables.concat(ec2Client
|
||||
|
|
|
@ -127,8 +127,8 @@ public class EC2RunNodesAndAddToSetStrategy implements RunNodesAndAddToSetStrate
|
|||
: null;
|
||||
|
||||
// if the location has a parent, it must be an availability zone.
|
||||
Region region = zone == null ? Region.fromValue(template.getLocation().getId()) : Region
|
||||
.fromValue(template.getLocation().getParent());
|
||||
String region = zone == null ? template.getLocation().getId() :
|
||||
template.getLocation().getParent();
|
||||
|
||||
// get or create incidental resources
|
||||
// TODO race condition. we were using MapMaker, but it doesn't seem to refresh properly when
|
||||
|
@ -188,7 +188,7 @@ public class EC2RunNodesAndAddToSetStrategy implements RunNodesAndAddToSetStrate
|
|||
return responses;
|
||||
}
|
||||
|
||||
private Iterable<RunningInstance> getInstances(Region region, Iterable<String> ids) {
|
||||
private Iterable<RunningInstance> getInstances(String region, Iterable<String> ids) {
|
||||
return Iterables.concat(ec2Client.getInstanceServices().describeInstancesInRegion(region,
|
||||
Iterables.toArray(ids, String.class)));
|
||||
}
|
||||
|
|
|
@ -115,10 +115,10 @@ public class EC2RestClientModule extends AbstractModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@EC2
|
||||
Region provideCurrentRegion(@EC2 Map<Region, URI> regionMap, @EC2 URI currentUri) {
|
||||
ImmutableBiMap<URI, Region> map = ImmutableBiMap.<Region, URI> builder().putAll(regionMap)
|
||||
String provideCurrentRegion(@EC2 Map<String, URI> regionMap, @EC2 URI currentUri) {
|
||||
ImmutableBiMap<URI, String> map = ImmutableBiMap.<String, URI> builder().putAll(regionMap)
|
||||
.build().inverse();
|
||||
Region region = map.get(currentUri);
|
||||
String region = map.get(currentUri);
|
||||
assert region != null : currentUri + " not in " + map;
|
||||
return region;
|
||||
}
|
||||
|
@ -126,16 +126,16 @@ public class EC2RestClientModule extends AbstractModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@EC2
|
||||
Map<Region, URI> provideRegions(AvailabilityZoneAndRegionClient client) {
|
||||
Map<String, URI> provideRegions(AvailabilityZoneAndRegionClient client) {
|
||||
return client.describeRegions();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Map<AvailabilityZone, Region> provideAvailabilityZoneToRegions(
|
||||
AvailabilityZoneAndRegionClient client, @EC2 Map<Region, URI> regions) {
|
||||
Map<AvailabilityZone, Region> map = Maps.newHashMap();
|
||||
for (Region region : regions.keySet()) {
|
||||
Map<AvailabilityZone, String> provideAvailabilityZoneToRegions(
|
||||
AvailabilityZoneAndRegionClient client, @EC2 Map<String, URI> regions) {
|
||||
Map<AvailabilityZone, String> map = Maps.newHashMap();
|
||||
for (String region : regions.keySet()) {
|
||||
for (AvailabilityZoneInfo zoneInfo : client.describeAvailabilityZonesInRegion(region)) {
|
||||
map.put(zoneInfo.getZone(), region);
|
||||
}
|
||||
|
|
|
@ -48,14 +48,14 @@ public class Attachment implements Comparable<Attachment> {
|
|||
}
|
||||
}
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String volumeId;
|
||||
private final String instanceId;
|
||||
private final String device;
|
||||
private final Status status;
|
||||
private final Date attachTime;
|
||||
|
||||
public Attachment(Region region, String volumeId, String instanceId, String device,
|
||||
public Attachment(String region, String volumeId, String instanceId, String device,
|
||||
Status status, Date attachTime) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
this.volumeId = volumeId;
|
||||
|
@ -69,7 +69,7 @@ public class Attachment implements Comparable<Attachment> {
|
|||
* Snapshots are tied to Regions and can only be used for volumes within the same Region.
|
||||
*
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,11 +54,11 @@ public class AvailabilityZoneInfo implements Comparable<AvailabilityZoneInfo>{
|
|||
private final String zoneName;
|
||||
private final AvailabilityZone zone;
|
||||
private final State state;
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final Set<String> messages = Sets.newHashSet();
|
||||
|
||||
public AvailabilityZoneInfo(String zoneName, AvailabilityZone zone, State zoneState,
|
||||
Region region, Iterable<String> messages) {
|
||||
String region, Iterable<String> messages) {
|
||||
this.zoneName = checkNotNull(zoneName, "zoneName");
|
||||
this.zone = checkNotNull(zone, "zone");
|
||||
this.state = checkNotNull(zoneState, "zoneState");
|
||||
|
@ -90,7 +90,7 @@ public class AvailabilityZoneInfo implements Comparable<AvailabilityZoneInfo>{
|
|||
/**
|
||||
* Name of the Region.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.inject.internal.Nullable;
|
|||
*/
|
||||
public class Image implements Comparable<Image> {
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final Architecture architecture;
|
||||
@Nullable
|
||||
private final String name;
|
||||
|
@ -62,7 +62,7 @@ public class Image implements Comparable<Image> {
|
|||
private final String rootDeviceName;
|
||||
private final Map<String, EbsBlockDevice> ebsBlockDevices = Maps.newHashMap();
|
||||
|
||||
public Image(Region region, Architecture architecture, @Nullable String name,
|
||||
public Image(String region, Architecture architecture, @Nullable String name,
|
||||
@Nullable String description, String imageId, String imageLocation,
|
||||
String imageOwnerId, ImageState imageState, ImageType imageType, boolean isPublic,
|
||||
Iterable<String> productCodes, @Nullable String kernelId, @Nullable String platform,
|
||||
|
@ -200,7 +200,7 @@ public class Image implements Comparable<Image> {
|
|||
* AMIs are tied to the Region where its files are located within Amazon S3.
|
||||
*
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.aws.domain.Region;
|
|||
*/
|
||||
public class InstanceStateChange implements Comparable<InstanceStateChange> {
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String instanceId;
|
||||
private final InstanceState currentState;
|
||||
private final InstanceState previousState;
|
||||
|
@ -40,7 +40,7 @@ public class InstanceStateChange implements Comparable<InstanceStateChange> {
|
|||
return (this == o) ? 0 : getInstanceId().compareTo(o.getInstanceId());
|
||||
}
|
||||
|
||||
public InstanceStateChange(Region region, String instanceId, InstanceState currentState,
|
||||
public InstanceStateChange(String region, String instanceId, InstanceState currentState,
|
||||
InstanceState previousState) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
this.instanceId = instanceId;
|
||||
|
@ -51,7 +51,7 @@ public class InstanceStateChange implements Comparable<InstanceStateChange> {
|
|||
/**
|
||||
* Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ import com.google.inject.internal.Nullable;
|
|||
* @author Adrian Cole
|
||||
*/
|
||||
public class KeyPair implements Comparable<KeyPair> {
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String keyName;
|
||||
private final String keyFingerprint;
|
||||
@Nullable
|
||||
private final String keyMaterial;
|
||||
|
||||
public KeyPair(Region region, String keyName, String keyFingerprint, @Nullable String keyMaterial) {
|
||||
public KeyPair(String region, String keyName, String keyFingerprint, @Nullable String keyMaterial) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
this.keyName = checkNotNull(keyName, "keyName");
|
||||
this.keyFingerprint = checkNotNull(keyFingerprint, "keyFingerprint");
|
||||
|
@ -48,7 +48,7 @@ public class KeyPair implements Comparable<KeyPair> {
|
|||
/**
|
||||
* Key pairs (to connect to instances) are Region-specific.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,12 +34,12 @@ import com.google.inject.internal.Nullable;
|
|||
*/
|
||||
public class PublicIpInstanceIdPair implements Comparable<PublicIpInstanceIdPair> {
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
@Nullable
|
||||
private final String instanceId;
|
||||
private final InetAddress publicIp;
|
||||
|
||||
public PublicIpInstanceIdPair(Region region, InetAddress publicIp, @Nullable String instanceId) {
|
||||
public PublicIpInstanceIdPair(String region, InetAddress publicIp, @Nullable String instanceId) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
this.instanceId = instanceId;
|
||||
this.publicIp = checkNotNull(publicIp, "publicIp");
|
||||
|
@ -48,7 +48,7 @@ public class PublicIpInstanceIdPair implements Comparable<PublicIpInstanceIdPair
|
|||
/**
|
||||
* Elastic IP addresses are tied to a Region and cannot be mapped across Regions.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class Reservation extends LinkedHashSet<RunningInstance> implements Compa
|
|||
|
||||
/** The serialVersionUID */
|
||||
private static final long serialVersionUID = -9051777593518861395L;
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final Set<String> groupIds = Sets.newLinkedHashSet();
|
||||
private final @Nullable
|
||||
String ownerId;
|
||||
|
@ -49,7 +49,7 @@ public class Reservation extends LinkedHashSet<RunningInstance> implements Compa
|
|||
private final @Nullable
|
||||
String reservationId;
|
||||
|
||||
public Reservation(Region region, Iterable<String> groupIds,
|
||||
public Reservation(String region, Iterable<String> groupIds,
|
||||
Iterable<RunningInstance> instances, @Nullable String ownerId,
|
||||
@Nullable String requesterId, @Nullable String reservationId) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
|
@ -63,7 +63,7 @@ public class Reservation extends LinkedHashSet<RunningInstance> implements Compa
|
|||
/**
|
||||
* Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ public class RunningInstance implements Comparable<RunningInstance> {
|
|||
|
||||
}
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String amiLaunchIndex;
|
||||
@Nullable
|
||||
private final String dnsName;
|
||||
|
@ -157,7 +157,7 @@ public class RunningInstance implements Comparable<RunningInstance> {
|
|||
return (this == o) ? 0 : getId().compareTo(o.getId());
|
||||
}
|
||||
|
||||
public RunningInstance(Region region, @Nullable String amiLaunchIndex, @Nullable String dnsName,
|
||||
public RunningInstance(String region, @Nullable String amiLaunchIndex, @Nullable String dnsName,
|
||||
String imageId, String instanceId, InstanceState instanceState,
|
||||
String instanceType, @Nullable InetAddress ipAddress, @Nullable String kernelId,
|
||||
@Nullable String keyName, Date launchTime, boolean monitoring,
|
||||
|
@ -195,7 +195,7 @@ public class RunningInstance implements Comparable<RunningInstance> {
|
|||
/**
|
||||
* Instance Ids are scoped to the region.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ import org.jclouds.aws.domain.Region;
|
|||
*/
|
||||
public class SecurityGroup implements Comparable<SecurityGroup> {
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String name;
|
||||
private final String ownerId;
|
||||
private final String description;
|
||||
private final Set<IpPermission> ipPermissions;
|
||||
|
||||
public SecurityGroup(Region region, String name, String ownerId, String description,
|
||||
public SecurityGroup(String region, String name, String ownerId, String description,
|
||||
Set<IpPermission> ipPermissions) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
this.name = name;
|
||||
|
@ -52,7 +52,7 @@ public class SecurityGroup implements Comparable<SecurityGroup> {
|
|||
* with instances outside the Region using group-based firewall rules. Traffic from instances in
|
||||
* another Region is seen as WAN bandwidth.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class Snapshot implements Comparable<Snapshot> {
|
|||
}
|
||||
}
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String id;
|
||||
private final String volumeId;
|
||||
private final int volumeSize;
|
||||
|
@ -58,7 +58,7 @@ public class Snapshot implements Comparable<Snapshot> {
|
|||
private final String description;
|
||||
private final String ownerAlias;
|
||||
|
||||
public Snapshot(Region region, String id, String volumeId, int volumeSize, Status status,
|
||||
public Snapshot(String region, String id, String volumeId, int volumeSize, Status status,
|
||||
Date startTime, int progress, String ownerId, String description, String ownerAlias) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
this.id = id;
|
||||
|
@ -75,7 +75,7 @@ public class Snapshot implements Comparable<Snapshot> {
|
|||
/**
|
||||
* Snapshots are tied to Regions and can only be used for volumes within the same Region.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ public class Volume implements Comparable<Volume> {
|
|||
}
|
||||
}
|
||||
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String id;
|
||||
private final int size;
|
||||
@Nullable
|
||||
|
@ -89,7 +89,7 @@ public class Volume implements Comparable<Volume> {
|
|||
private final Date createTime;
|
||||
private final Set<Attachment> attachments = Sets.newLinkedHashSet();
|
||||
|
||||
public Volume(Region region, String id, int size, String snapshotId,
|
||||
public Volume(String region, String id, int size, String snapshotId,
|
||||
AvailabilityZone availabilityZone, Volume.Status status, Date createTime,
|
||||
Iterable<Attachment> attachments) {
|
||||
this.region = checkNotNull(region, "region");
|
||||
|
@ -106,7 +106,7 @@ public class Volume implements Comparable<Volume> {
|
|||
* An Amazon EBS volume must be located within the same Availability Zone as the instance to
|
||||
* which it attaches.
|
||||
*/
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,12 +36,12 @@ import com.google.common.base.Function;
|
|||
*/
|
||||
@Singleton
|
||||
public class AvailabilityZoneToEndpoint implements Function<Object, URI> {
|
||||
private final Map<AvailabilityZone, Region> availabilityZoneToRegion;
|
||||
private final Map<Region, URI> regionToEndpoint;
|
||||
private final Map<AvailabilityZone, String> availabilityZoneToRegion;
|
||||
private final Map<String, URI> regionToEndpoint;
|
||||
|
||||
@Inject
|
||||
public AvailabilityZoneToEndpoint(@EC2 Map<Region, URI> regionToEndpoint,
|
||||
Map<AvailabilityZone, Region> availabilityZoneToRegion) {
|
||||
public AvailabilityZoneToEndpoint(@EC2 Map<String, URI> regionToEndpoint,
|
||||
Map<AvailabilityZone, String> availabilityZoneToRegion) {
|
||||
this.regionToEndpoint = regionToEndpoint;
|
||||
this.availabilityZoneToRegion = availabilityZoneToRegion;
|
||||
}
|
||||
|
|
|
@ -35,11 +35,11 @@ import com.google.common.base.Function;
|
|||
*/
|
||||
@Singleton
|
||||
public class RegionToEndpoint implements Function<Object, URI> {
|
||||
private final Map<Region, URI> regionToEndpoint;
|
||||
private final Map<String, URI> regionToEndpoint;
|
||||
private final URI defaultUri;
|
||||
|
||||
@Inject
|
||||
public RegionToEndpoint(@EC2 Map<Region, URI> regionToEndpoint, @EC2 URI defaultUri) {
|
||||
public RegionToEndpoint(@EC2 Map<String, URI> regionToEndpoint, @EC2 URI defaultUri) {
|
||||
this.regionToEndpoint = regionToEndpoint;
|
||||
this.defaultUri = defaultUri;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
package org.jclouds.aws.ec2.options;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
|
@ -46,10 +47,8 @@ public class DescribeRegionsOptions extends BaseEC2RequestOptions {
|
|||
/**
|
||||
* Name of a Region.
|
||||
*/
|
||||
public DescribeRegionsOptions regions(Region... regions) {
|
||||
String[] regionStrings = new String[regions.length];
|
||||
for (int i = 0; i < regionStrings.length; i++)
|
||||
regionStrings[i] = regions[i].value();
|
||||
public DescribeRegionsOptions regions(String... regions) {
|
||||
String[] regionStrings = Arrays.copyOf(regions, regions.length, String[].class);
|
||||
indexFormValuesWithPrefix("RegionName", regionStrings);
|
||||
return this;
|
||||
}
|
||||
|
@ -63,7 +62,7 @@ public class DescribeRegionsOptions extends BaseEC2RequestOptions {
|
|||
/**
|
||||
* @see DescribeRegionsOptions#regions(Region[] )
|
||||
*/
|
||||
public static DescribeRegionsOptions regions(Region... regions) {
|
||||
public static DescribeRegionsOptions regions(String... regions) {
|
||||
DescribeRegionsOptions options = new DescribeRegionsOptions();
|
||||
return options.regions(regions);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ import javax.ws.rs.FormParam;
|
|||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.binders.BindProductCodesToIndexedFormParams;
|
||||
import org.jclouds.aws.ec2.binders.BindUserGroupsToIndexedFormParams;
|
||||
import org.jclouds.aws.ec2.binders.BindUserIdsToIndexedFormParams;
|
||||
|
@ -75,7 +74,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeImages")
|
||||
@XMLResponseParser(DescribeImagesResponseHandler.class)
|
||||
ListenableFuture<? extends Set<Image>> describeImagesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
DescribeImagesOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -86,7 +85,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "CreateImage")
|
||||
@XMLResponseParser(ImageIdHandler.class)
|
||||
ListenableFuture<String> createImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("Name") String name, @FormParam("InstanceId") String instanceId,
|
||||
CreateImageOptions... options);
|
||||
|
||||
|
@ -97,7 +96,7 @@ public interface AMIAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "DeregisterImage")
|
||||
ListenableFuture<Void> deregisterImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
||||
/**
|
||||
|
@ -108,7 +107,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "RegisterImage")
|
||||
@XMLResponseParser(ImageIdHandler.class)
|
||||
ListenableFuture<String> registerImageFromManifestInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("Name") String imageName, @FormParam("ImageLocation") String pathToManifest,
|
||||
RegisterImageOptions... options);
|
||||
|
||||
|
@ -121,7 +120,7 @@ public interface AMIAsyncClient {
|
|||
"RegisterImage", "/dev/sda1", "/dev/sda1" })
|
||||
@XMLResponseParser(ImageIdHandler.class)
|
||||
ListenableFuture<String> registerUnixImageBackedByEbsInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("Name") String imageName,
|
||||
@FormParam("BlockDeviceMapping.0.Ebs.SnapshotId") String ebsSnapshotId,
|
||||
RegisterImageBackedByEbsOptions... options);
|
||||
|
@ -133,7 +132,7 @@ public interface AMIAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ResetImageAttribute", "launchPermission" })
|
||||
ListenableFuture<Void> resetLaunchPermissionsOnImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
||||
/**
|
||||
|
@ -144,7 +143,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = { "ModifyImageAttribute",
|
||||
"add", "launchPermission" })
|
||||
ListenableFuture<Void> addLaunchPermissionsToImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindUserIdsToIndexedFormParams.class) Iterable<String> userIds,
|
||||
@BinderParam(BindUserGroupsToIndexedFormParams.class) Iterable<String> userGroups,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
@ -157,7 +156,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = { "ModifyImageAttribute",
|
||||
"remove", "launchPermission" })
|
||||
ListenableFuture<Void> removeLaunchPermissionsFromImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindUserIdsToIndexedFormParams.class) Iterable<String> userIds,
|
||||
@BinderParam(BindUserGroupsToIndexedFormParams.class) Iterable<String> userGroups,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
@ -171,7 +170,7 @@ public interface AMIAsyncClient {
|
|||
"launchPermission" })
|
||||
@XMLResponseParser(PermissionHandler.class)
|
||||
ListenableFuture<Permission> getLaunchPermissionForImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
||||
/**
|
||||
|
@ -182,7 +181,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeImageAttribute", "productCodes" })
|
||||
@XMLResponseParser(ProductCodesHandler.class)
|
||||
ListenableFuture<? extends Set<String>> getProductCodesForImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
||||
/**
|
||||
|
@ -194,7 +193,7 @@ public interface AMIAsyncClient {
|
|||
"blockDeviceMapping" })
|
||||
@XMLResponseParser(BlockDeviceMappingHandler.class)
|
||||
ListenableFuture<? extends Map<String, EbsBlockDevice>> getBlockDeviceMappingsForImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
||||
/**
|
||||
|
@ -205,7 +204,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = { "ModifyImageAttribute",
|
||||
"add", "productCodes" })
|
||||
ListenableFuture<Void> addProductCodesToImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindProductCodesToIndexedFormParams.class) Iterable<String> productCodes,
|
||||
@FormParam("ImageId") String imageId);
|
||||
|
||||
|
@ -217,7 +216,7 @@ public interface AMIAsyncClient {
|
|||
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = { "ModifyImageAttribute",
|
||||
"remove", "productCodes" })
|
||||
ListenableFuture<Void> removeProductCodesFromImageInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindProductCodesToIndexedFormParams.class) Iterable<String> productCodes,
|
||||
@FormParam("ImageId") String imageId);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.domain.Image;
|
||||
import org.jclouds.aws.ec2.domain.Permission;
|
||||
import org.jclouds.aws.ec2.domain.Image.EbsBlockDevice;
|
||||
|
@ -58,7 +57,7 @@ public interface AMIClient {
|
|||
* @see DescribeImagesOptions
|
||||
*/
|
||||
@Timeout(duration = 300, timeUnit = TimeUnit.SECONDS)
|
||||
Set<Image> describeImagesInRegion(@Nullable Region region, DescribeImagesOptions... options);
|
||||
Set<Image> describeImagesInRegion(@Nullable String region, DescribeImagesOptions... options);
|
||||
|
||||
/**
|
||||
* Returns the Product Codes of an image.
|
||||
|
@ -74,7 +73,7 @@ public interface AMIClient {
|
|||
* />
|
||||
* @see DescribeImagesOptions
|
||||
*/
|
||||
Set<String> getProductCodesForImageInRegion(@Nullable Region region, String imageId);
|
||||
Set<String> getProductCodesForImageInRegion(@Nullable String region, String imageId);
|
||||
|
||||
/**
|
||||
* Returns a map of device name to block device for the image.
|
||||
|
@ -90,7 +89,7 @@ public interface AMIClient {
|
|||
* />
|
||||
* @see DescribeImagesOptions
|
||||
*/
|
||||
Map<String, EbsBlockDevice> getBlockDeviceMappingsForImageInRegion(@Nullable Region region, String imageId);
|
||||
Map<String, EbsBlockDevice> getBlockDeviceMappingsForImageInRegion(@Nullable String region, String imageId);
|
||||
|
||||
/**
|
||||
* Creates an AMI that uses an Amazon EBS root device from a "running" or "stopped" instance.
|
||||
|
@ -114,7 +113,7 @@ public interface AMIClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateImage.html"
|
||||
* />
|
||||
*/
|
||||
String createImageInRegion(@Nullable Region region, String name, String instanceId,
|
||||
String createImageInRegion(@Nullable String region, String name, String instanceId,
|
||||
CreateImageOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -134,7 +133,7 @@ public interface AMIClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeregisterImage.html"
|
||||
* />
|
||||
*/
|
||||
void deregisterImageInRegion(@Nullable Region region, String imageId);
|
||||
void deregisterImageInRegion(@Nullable String region, String imageId);
|
||||
|
||||
/**
|
||||
* Registers an AMI with Amazon EC2. Images must be registered before they can be launched. To
|
||||
|
@ -164,7 +163,7 @@ public interface AMIClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-RegisterImage.html"
|
||||
* />
|
||||
*/
|
||||
String registerImageFromManifestInRegion(@Nullable Region region, String name, String pathToManifest,
|
||||
String registerImageFromManifestInRegion(@Nullable String region, String name, String pathToManifest,
|
||||
RegisterImageOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -199,7 +198,7 @@ public interface AMIClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-RegisterImage.html"
|
||||
* />
|
||||
*/
|
||||
String registerUnixImageBackedByEbsInRegion(@Nullable Region region, String name, String ebsSnapshotId,
|
||||
String registerUnixImageBackedByEbsInRegion(@Nullable String region, String name, String ebsSnapshotId,
|
||||
RegisterImageBackedByEbsOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -216,7 +215,7 @@ public interface AMIClient {
|
|||
* />
|
||||
* @see DescribeImagesOptions
|
||||
*/
|
||||
Permission getLaunchPermissionForImageInRegion(@Nullable Region region, String imageId);
|
||||
Permission getLaunchPermissionForImageInRegion(@Nullable String region, String imageId);
|
||||
|
||||
/**
|
||||
* Adds {@code launchPermission}s to an AMI.
|
||||
|
@ -236,7 +235,7 @@ public interface AMIClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyImageAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void addLaunchPermissionsToImageInRegion(@Nullable Region region, Iterable<String> userIds,
|
||||
void addLaunchPermissionsToImageInRegion(@Nullable String region, Iterable<String> userIds,
|
||||
Iterable<String> userGroups, String imageId);
|
||||
|
||||
/**
|
||||
|
@ -253,7 +252,7 @@ public interface AMIClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ResetImageAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void resetLaunchPermissionsOnImageInRegion(@Nullable Region region, String imageId);
|
||||
void resetLaunchPermissionsOnImageInRegion(@Nullable String region, String imageId);
|
||||
|
||||
/**
|
||||
* Removes {@code launchPermission}s from an AMI.
|
||||
|
@ -273,7 +272,7 @@ public interface AMIClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyImageAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void removeLaunchPermissionsFromImageInRegion(@Nullable Region region, Iterable<String> userIds,
|
||||
void removeLaunchPermissionsFromImageInRegion(@Nullable String region, Iterable<String> userIds,
|
||||
Iterable<String> userGroups, String imageId);
|
||||
|
||||
/**
|
||||
|
@ -292,7 +291,7 @@ public interface AMIClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyImageAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void addProductCodesToImageInRegion(@Nullable Region region, Iterable<String> productCodes, String imageId);
|
||||
void addProductCodesToImageInRegion(@Nullable String region, Iterable<String> productCodes, String imageId);
|
||||
|
||||
/**
|
||||
* Removes {@code productCode}s from an AMI.
|
||||
|
@ -310,6 +309,6 @@ public interface AMIClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyImageAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void removeProductCodesFromImageInRegion(@Nullable Region region, Iterable<String> productCodes,
|
||||
void removeProductCodesFromImageInRegion(@Nullable String region, Iterable<String> productCodes,
|
||||
String imageId);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public interface AvailabilityZoneAndRegionAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeAvailabilityZones")
|
||||
@XMLResponseParser(DescribeAvailabilityZonesResponseHandler.class)
|
||||
ListenableFuture<? extends Set<AvailabilityZoneInfo>> describeAvailabilityZonesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
DescribeAvailabilityZonesOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -77,6 +77,6 @@ public interface AvailabilityZoneAndRegionAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "DescribeRegions")
|
||||
@XMLResponseParser(DescribeRegionsResponseHandler.class)
|
||||
ListenableFuture<? extends Map<Region, URI>> describeRegions(DescribeRegionsOptions... options);
|
||||
ListenableFuture<? extends Map<String, URI>> describeRegions(DescribeRegionsOptions... options);
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public interface AvailabilityZoneAndRegionClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAvailabilityZones.html"
|
||||
* />
|
||||
*/
|
||||
Set<AvailabilityZoneInfo> describeAvailabilityZonesInRegion(@Nullable Region region,
|
||||
Set<AvailabilityZoneInfo> describeAvailabilityZonesInRegion(@Nullable String region,
|
||||
DescribeAvailabilityZonesOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -62,5 +62,5 @@ public interface AvailabilityZoneAndRegionClient {
|
|||
* />
|
||||
*/
|
||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||
Map<Region, URI> describeRegions(DescribeRegionsOptions... options);
|
||||
Map<String, URI> describeRegions(DescribeRegionsOptions... options);
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeVolumes")
|
||||
@XMLResponseParser(DescribeVolumesResponseHandler.class)
|
||||
ListenableFuture<? extends Set<Volume>> describeVolumesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindVolumeIdsToIndexedFormParams.class) String... volumeIds);
|
||||
|
||||
/**
|
||||
|
@ -122,7 +122,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "DeleteVolume")
|
||||
ListenableFuture<Void> deleteVolumeInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("VolumeId") String volumeId);
|
||||
|
||||
/**
|
||||
|
@ -133,7 +133,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DetachVolume")
|
||||
@ExceptionParser(ReturnVoidOnVolumeAvailable.class)
|
||||
ListenableFuture<Void> detachVolumeInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("VolumeId") String volumeId, @FormParam("Force") boolean force,
|
||||
DetachVolumeOptions... options);
|
||||
|
||||
|
@ -145,7 +145,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "AttachVolume")
|
||||
@XMLResponseParser(AttachmentHandler.class)
|
||||
ListenableFuture<Attachment> attachVolumeInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("VolumeId") String volumeId, @FormParam("InstanceId") String instanceId,
|
||||
@FormParam("Device") String device);
|
||||
|
||||
|
@ -157,7 +157,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "CreateSnapshot")
|
||||
@XMLResponseParser(SnapshotHandler.class)
|
||||
ListenableFuture<Snapshot> createSnapshotInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("VolumeId") String volumeId, CreateSnapshotOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -168,7 +168,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeSnapshots")
|
||||
@XMLResponseParser(DescribeSnapshotsResponseHandler.class)
|
||||
ListenableFuture<? extends Set<Snapshot>> describeSnapshotsInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
DescribeSnapshotsOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -178,7 +178,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "DeleteSnapshot")
|
||||
ListenableFuture<Void> deleteSnapshotInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("SnapshotId") String snapshotId);
|
||||
|
||||
/**
|
||||
|
@ -189,7 +189,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = {
|
||||
"ModifySnapshotAttribute", "add", "createVolumePermission" })
|
||||
ListenableFuture<Void> addCreateVolumePermissionsToSnapshotInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindUserIdsToIndexedFormParams.class) Iterable<String> userIds,
|
||||
@BinderParam(BindUserGroupsToIndexedFormParams.class) Iterable<String> userGroups,
|
||||
@FormParam("SnapshotId") String snapshotId);
|
||||
|
@ -202,7 +202,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = { ACTION, "OperationType", "Attribute" }, values = {
|
||||
"ModifySnapshotAttribute", "remove", "createVolumePermission" })
|
||||
ListenableFuture<Void> removeCreateVolumePermissionsFromSnapshotInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindUserIdsToIndexedFormParams.class) Iterable<String> userIds,
|
||||
@BinderParam(BindUserGroupsToIndexedFormParams.class) Iterable<String> userGroups,
|
||||
@FormParam("SnapshotId") String snapshotId);
|
||||
|
@ -216,7 +216,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
"createVolumePermission" })
|
||||
@XMLResponseParser(PermissionHandler.class)
|
||||
ListenableFuture<Permission> getCreateVolumePermissionForSnapshotInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("SnapshotId") String snapshotId);
|
||||
|
||||
/**
|
||||
|
@ -227,7 +227,7 @@ public interface ElasticBlockStoreAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ResetSnapshotAttribute",
|
||||
"createVolumePermission" })
|
||||
ListenableFuture<Void> resetCreateVolumePermissionsOnSnapshotInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("SnapshotId") String snapshotId);
|
||||
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html"
|
||||
* />
|
||||
*/
|
||||
Set<Volume> describeVolumesInRegion(@Nullable Region region, String... volumeIds);
|
||||
Set<Volume> describeVolumesInRegion(@Nullable String region, String... volumeIds);
|
||||
|
||||
/**
|
||||
* Deletes an Amazon EBS volume that you own. For more information about Amazon EBS, go to the
|
||||
|
@ -159,7 +159,7 @@ public interface ElasticBlockStoreClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteVolume.html"
|
||||
* />
|
||||
*/
|
||||
void deleteVolumeInRegion(@Nullable Region region, String volumeId);
|
||||
void deleteVolumeInRegion(@Nullable String region, String volumeId);
|
||||
|
||||
/**
|
||||
* Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.
|
||||
|
@ -199,7 +199,7 @@ public interface ElasticBlockStoreClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DetachVolume.html"
|
||||
* />
|
||||
*/
|
||||
void detachVolumeInRegion(@Nullable Region region, String volumeId, boolean force,
|
||||
void detachVolumeInRegion(@Nullable String region, String volumeId, boolean force,
|
||||
DetachVolumeOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -232,7 +232,7 @@ public interface ElasticBlockStoreClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-AttachVolume.html"
|
||||
* />
|
||||
*/
|
||||
Attachment attachVolumeInRegion(@Nullable Region region, String volumeId, String instanceId, String device);
|
||||
Attachment attachVolumeInRegion(@Nullable String region, String volumeId, String instanceId, String device);
|
||||
|
||||
/**
|
||||
* Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots
|
||||
|
@ -269,7 +269,7 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateSnapshot.html"
|
||||
* />
|
||||
*/
|
||||
Snapshot createSnapshotInRegion(@Nullable Region region, String volumeId, CreateSnapshotOptions... options);
|
||||
Snapshot createSnapshotInRegion(@Nullable String region, String volumeId, CreateSnapshotOptions... options);
|
||||
|
||||
/**
|
||||
* Returns information about Amazon EBS snapshots available to the user. Information returned
|
||||
|
@ -330,7 +330,7 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html"
|
||||
* />
|
||||
*/
|
||||
Set<Snapshot> describeSnapshotsInRegion(@Nullable Region region, DescribeSnapshotsOptions... options);
|
||||
Set<Snapshot> describeSnapshotsInRegion(@Nullable String region, DescribeSnapshotsOptions... options);
|
||||
|
||||
/**
|
||||
* Deletes a snapshot of an Amazon EBS volume that you own. For more information, go to the
|
||||
|
@ -347,7 +347,7 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSnapshot.html"
|
||||
* />
|
||||
*/
|
||||
void deleteSnapshotInRegion(@Nullable Region region, String snapshotId);
|
||||
void deleteSnapshotInRegion(@Nullable String region, String snapshotId);
|
||||
|
||||
/**
|
||||
* Returns the {@link Permission}s of an snapshot.
|
||||
|
@ -363,7 +363,7 @@ public interface ElasticBlockStoreClient {
|
|||
* />
|
||||
* @see DescribeSnapshotsOptions
|
||||
*/
|
||||
Permission getCreateVolumePermissionForSnapshotInRegion(@Nullable Region region, String snapshotId);
|
||||
Permission getCreateVolumePermissionForSnapshotInRegion(@Nullable String region, String snapshotId);
|
||||
|
||||
/**
|
||||
* Adds {@code createVolumePermission}s to an EBS snapshot.
|
||||
|
@ -384,7 +384,7 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifySnapshotAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void addCreateVolumePermissionsToSnapshotInRegion(@Nullable Region region, Iterable<String> userIds,
|
||||
void addCreateVolumePermissionsToSnapshotInRegion(@Nullable String region, Iterable<String> userIds,
|
||||
Iterable<String> userGroups, String snapshotId);
|
||||
|
||||
/**
|
||||
|
@ -402,7 +402,7 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ResetSnapshotAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void resetCreateVolumePermissionsOnSnapshotInRegion(@Nullable Region region, String snapshotId);
|
||||
void resetCreateVolumePermissionsOnSnapshotInRegion(@Nullable String region, String snapshotId);
|
||||
|
||||
/**
|
||||
* Removes {@code createVolumePermission}s from an EBS snapshot.
|
||||
|
@ -423,6 +423,6 @@ public interface ElasticBlockStoreClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifySnapshotAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void removeCreateVolumePermissionsFromSnapshotInRegion(@Nullable Region region, Iterable<String> userIds,
|
||||
void removeCreateVolumePermissionsFromSnapshotInRegion(@Nullable String region, Iterable<String> userIds,
|
||||
Iterable<String> userGroups, String snapshotId);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public interface ElasticIPAddressAsyncClient {
|
|||
@XMLResponseParser(AllocateAddressResponseHandler.class)
|
||||
@FormParams(keys = ACTION, values = "AllocateAddress")
|
||||
ListenableFuture<InetAddress> allocateAddressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region);
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region);
|
||||
|
||||
/**
|
||||
* @see BaseEC2Client#associateAddressInRegion
|
||||
|
@ -75,7 +75,7 @@ public interface ElasticIPAddressAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "AssociateAddress")
|
||||
ListenableFuture<Void> associateAddressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("PublicIp") @ParamParser(InetAddressToHostAddress.class) InetAddress publicIp,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
|
@ -86,7 +86,7 @@ public interface ElasticIPAddressAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "DisassociateAddress")
|
||||
ListenableFuture<Void> disassociateAddressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("PublicIp") @ParamParser(InetAddressToHostAddress.class) InetAddress publicIp);
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ public interface ElasticIPAddressAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "ReleaseAddress")
|
||||
ListenableFuture<Void> releaseAddressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("PublicIp") @ParamParser(InetAddressToHostAddress.class) InetAddress publicIp);
|
||||
|
||||
/**
|
||||
|
@ -107,7 +107,7 @@ public interface ElasticIPAddressAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeAddresses")
|
||||
@XMLResponseParser(DescribeAddressesResponseHandler.class)
|
||||
ListenableFuture<? extends Set<PublicIpInstanceIdPair>> describeAddressesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindInetAddressesToIndexedFormParams.class) InetAddress... publicIps);
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public interface ElasticIPAddressClient {
|
|||
* @see #disassociateAddress
|
||||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-AllocateAddress.html"
|
||||
*/
|
||||
InetAddress allocateAddressInRegion(@Nullable Region region);
|
||||
InetAddress allocateAddressInRegion(@Nullable String region);
|
||||
|
||||
/**
|
||||
* Associates an elastic IP address with an instance. If the IP address is currently assigned to
|
||||
|
@ -69,7 +69,7 @@ public interface ElasticIPAddressClient {
|
|||
* @see #disassociateAddress
|
||||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-AssociateAddress.html"
|
||||
*/
|
||||
void associateAddressInRegion(@Nullable Region region, InetAddress publicIp, String instanceId);
|
||||
void associateAddressInRegion(@Nullable String region, InetAddress publicIp, String instanceId);
|
||||
|
||||
/**
|
||||
* Disassociates the specified elastic IP address from the instance to which it is assigned. This
|
||||
|
@ -87,7 +87,7 @@ public interface ElasticIPAddressClient {
|
|||
* @see #associateAddress
|
||||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-DisdisassociateAddress.html"
|
||||
*/
|
||||
void disassociateAddressInRegion(@Nullable Region region, InetAddress publicIp);
|
||||
void disassociateAddressInRegion(@Nullable String region, InetAddress publicIp);
|
||||
|
||||
/**
|
||||
* Releases an elastic IP address associated with your account.
|
||||
|
@ -103,7 +103,7 @@ public interface ElasticIPAddressClient {
|
|||
* @see #disassociateAddress
|
||||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-ReleaseAddress.html"
|
||||
*/
|
||||
void releaseAddressInRegion(@Nullable Region region, InetAddress publicIp);
|
||||
void releaseAddressInRegion(@Nullable String region, InetAddress publicIp);
|
||||
|
||||
/**
|
||||
* Lists elastic IP addresses assigned to your account or provides information about a specific
|
||||
|
@ -121,7 +121,7 @@ public interface ElasticIPAddressClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAddresses.html"
|
||||
* />
|
||||
*/
|
||||
Set<PublicIpInstanceIdPair> describeAddressesInRegion(@Nullable Region region,
|
||||
Set<PublicIpInstanceIdPair> describeAddressesInRegion(@Nullable String region,
|
||||
InetAddress... publicIps);
|
||||
|
||||
}
|
|
@ -29,7 +29,6 @@ import javax.ws.rs.FormParam;
|
|||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.binders.BindBlockDeviceMappingToIndexedFormParams;
|
||||
import org.jclouds.aws.ec2.binders.BindInstanceIdsToIndexedFormParams;
|
||||
import org.jclouds.aws.ec2.binders.IfNotNullBindAvailabilityZoneToFormParam;
|
||||
|
@ -77,7 +76,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeInstances")
|
||||
@XMLResponseParser(DescribeInstancesResponseHandler.class)
|
||||
ListenableFuture<? extends Set<Reservation>> describeInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
|
||||
/**
|
||||
|
@ -88,7 +87,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "RunInstances")
|
||||
@XMLResponseParser(RunInstancesResponseHandler.class)
|
||||
ListenableFuture<Reservation> runInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@Nullable @BinderParam(IfNotNullBindAvailabilityZoneToFormParam.class) AvailabilityZone nullableAvailabilityZone,
|
||||
@FormParam("ImageId") String imageId, @FormParam("MinCount") int minCount,
|
||||
@FormParam("MaxCount") int maxCount, RunInstancesOptions... options);
|
||||
|
@ -100,7 +99,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "RebootInstances")
|
||||
ListenableFuture<Void> rebootInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
|
||||
/**
|
||||
|
@ -111,7 +110,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "TerminateInstances")
|
||||
@XMLResponseParser(InstanceStateChangeHandler.class)
|
||||
ListenableFuture<? extends Set<InstanceStateChange>> terminateInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
|
||||
/**
|
||||
|
@ -122,7 +121,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "StopInstances")
|
||||
@XMLResponseParser(InstanceStateChangeHandler.class)
|
||||
ListenableFuture<? extends Set<InstanceStateChange>> stopInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("Force") boolean force,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
|
||||
|
@ -134,7 +133,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "StartInstances")
|
||||
@XMLResponseParser(InstanceStateChangeHandler.class)
|
||||
ListenableFuture<? extends Set<InstanceStateChange>> startInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
|
||||
/**
|
||||
|
@ -145,7 +144,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeInstanceAttribute", "userData" })
|
||||
@XMLResponseParser(UnencodeStringValueHandler.class)
|
||||
ListenableFuture<String> getUserDataForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -157,7 +156,7 @@ public interface InstanceAsyncClient {
|
|||
"rootDeviceName" })
|
||||
@XMLResponseParser(StringValueHandler.class)
|
||||
ListenableFuture<String> getRootDeviceNameForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -168,7 +167,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeInstanceAttribute", "ramdisk" })
|
||||
@XMLResponseParser(StringValueHandler.class)
|
||||
ListenableFuture<String> getRamdiskForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -179,7 +178,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "DescribeInstanceAttribute", "kernel" })
|
||||
@XMLResponseParser(StringValueHandler.class)
|
||||
ListenableFuture<String> getKernelForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -191,7 +190,7 @@ public interface InstanceAsyncClient {
|
|||
"disableApiTermination" })
|
||||
@XMLResponseParser(BooleanValueHandler.class)
|
||||
ListenableFuture<Boolean> isApiTerminationDisabledForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -203,7 +202,7 @@ public interface InstanceAsyncClient {
|
|||
"instanceType" })
|
||||
@XMLResponseParser(InstanceTypeHandler.class)
|
||||
ListenableFuture<String> getInstanceTypeForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -215,7 +214,7 @@ public interface InstanceAsyncClient {
|
|||
"instanceInitiatedShutdownBehavior" })
|
||||
@XMLResponseParser(InstanceInitiatedShutdownBehaviorHandler.class)
|
||||
ListenableFuture<InstanceInitiatedShutdownBehavior> getInstanceInitiatedShutdownBehaviorForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -227,7 +226,7 @@ public interface InstanceAsyncClient {
|
|||
"blockDeviceMapping" })
|
||||
@XMLResponseParser(BlockDeviceMappingHandler.class)
|
||||
ListenableFuture<? extends Map<String, RunningInstance.EbsBlockDevice>> getBlockDeviceMappingForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -237,7 +236,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ResetInstanceAttribute", "ramdisk" })
|
||||
ListenableFuture<Void> resetRamdiskForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -247,7 +246,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ResetInstanceAttribute", "kernel" })
|
||||
ListenableFuture<Void> resetKernelForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -257,7 +256,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ModifyInstanceAttribute", "userData" })
|
||||
ListenableFuture<Void> setUserDataForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId,
|
||||
@FormParam("Value") @ParamParser(ConvertUnencodedBytesToBase64EncodedString.class) byte[] unencodedData);
|
||||
|
||||
|
@ -268,7 +267,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ModifyInstanceAttribute", "ramdisk" })
|
||||
ListenableFuture<Void> setRamdiskForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId, @FormParam("Value") String ramdisk);
|
||||
|
||||
/**
|
||||
|
@ -278,7 +277,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ModifyInstanceAttribute", "kernel" })
|
||||
ListenableFuture<Void> setKernelForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId, @FormParam("Value") String kernel);
|
||||
|
||||
/**
|
||||
|
@ -289,7 +288,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ModifyInstanceAttribute",
|
||||
"disableApiTermination" })
|
||||
ListenableFuture<Void> setApiTerminationDisabledForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId,
|
||||
@FormParam("Value") boolean apiTerminationDisabled);
|
||||
|
||||
|
@ -300,7 +299,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ModifyInstanceAttribute", "instanceType" })
|
||||
ListenableFuture<Void> setInstanceTypeForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId,
|
||||
@FormParam("Value") String instanceType);
|
||||
|
||||
|
@ -312,7 +311,7 @@ public interface InstanceAsyncClient {
|
|||
@FormParams(keys = { ACTION, "Attribute" }, values = { "ModifyInstanceAttribute",
|
||||
"instanceInitiatedShutdownBehavior" })
|
||||
ListenableFuture<Void> setInstanceInitiatedShutdownBehaviorForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId,
|
||||
@FormParam("Value") InstanceInitiatedShutdownBehavior instanceInitiatedShutdownBehavior);
|
||||
|
||||
|
@ -323,7 +322,7 @@ public interface InstanceAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = { ACTION }, values = { "ModifyInstanceAttribute" })
|
||||
ListenableFuture<Void> setBlockDeviceMappingForInstanceInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId") String instanceId,
|
||||
@BinderParam(BindBlockDeviceMappingToIndexedFormParams.class) BlockDeviceMapping blockDeviceMapping);
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.domain.*;
|
||||
import org.jclouds.aws.ec2.domain.RunningInstance.EbsBlockDevice;
|
||||
import org.jclouds.aws.ec2.domain.Volume.InstanceInitiatedShutdownBehavior;
|
||||
|
@ -61,7 +60,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html"
|
||||
* />
|
||||
*/
|
||||
Set<Reservation> describeInstancesInRegion(@Nullable Region region, String... instanceIds);
|
||||
Set<Reservation> describeInstancesInRegion(@Nullable String region, String... instanceIds);
|
||||
|
||||
/**
|
||||
* Launches a specified number of instances of an AMI for which you have permissions.
|
||||
|
@ -134,7 +133,7 @@ public interface InstanceClient {
|
|||
* />
|
||||
* @see RunInstancesOptions
|
||||
*/
|
||||
Reservation runInstancesInRegion(@Nullable Region region,
|
||||
Reservation runInstancesInRegion(@Nullable String region,
|
||||
@Nullable AvailabilityZone nullableAvailabilityZone, String imageId, int minCount,
|
||||
int maxCount, RunInstancesOptions... options);
|
||||
|
||||
|
@ -153,7 +152,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-TerminateInstances.html"
|
||||
* />
|
||||
*/
|
||||
Set<InstanceStateChange> terminateInstancesInRegion(@Nullable Region region, String... instanceIds);
|
||||
Set<InstanceStateChange> terminateInstancesInRegion(@Nullable String region, String... instanceIds);
|
||||
|
||||
/**
|
||||
* Stops an instance that uses an Amazon EBS volume as its root device.
|
||||
|
@ -189,7 +188,7 @@ public interface InstanceClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-StopInstances.html"
|
||||
* />
|
||||
*/
|
||||
Set<InstanceStateChange> stopInstancesInRegion(@Nullable Region region, boolean force,
|
||||
Set<InstanceStateChange> stopInstancesInRegion(@Nullable String region, boolean force,
|
||||
String... instanceIds);
|
||||
|
||||
/**
|
||||
|
@ -214,7 +213,7 @@ public interface InstanceClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-StopInstances.html"
|
||||
* />
|
||||
*/
|
||||
void rebootInstancesInRegion(@Nullable Region region, String... instanceIds);
|
||||
void rebootInstancesInRegion(@Nullable String region, String... instanceIds);
|
||||
|
||||
/**
|
||||
* Starts an instance that uses an Amazon EBS volume as its root device.
|
||||
|
@ -244,7 +243,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-StartInstances.html"
|
||||
* />
|
||||
*/
|
||||
Set<InstanceStateChange> startInstancesInRegion(@Nullable Region region, String... instanceIds);
|
||||
Set<InstanceStateChange> startInstancesInRegion(@Nullable String region, String... instanceIds);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -255,7 +254,7 @@ public interface InstanceClient {
|
|||
* which instance to describe the attribute of
|
||||
* @return unencoded user data
|
||||
*/
|
||||
String getUserDataForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String getUserDataForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -266,7 +265,7 @@ public interface InstanceClient {
|
|||
* which instance to describe the attribute of
|
||||
* @return The root device name (e.g., /dev/sda1).
|
||||
*/
|
||||
String getRootDeviceNameForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String getRootDeviceNameForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -277,7 +276,7 @@ public interface InstanceClient {
|
|||
* which instance to describe the attribute of
|
||||
* @return the ID of the RAM disk associated with the AMI.
|
||||
*/
|
||||
String getRamdiskForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String getRamdiskForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -288,7 +287,7 @@ public interface InstanceClient {
|
|||
* which instance to describe the attribute of
|
||||
* @return the ID of the kernel associated with the AMI.
|
||||
*/
|
||||
String getKernelForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String getKernelForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -300,7 +299,7 @@ public interface InstanceClient {
|
|||
* @return Specifies whether the instance can be terminated using the APIs. You must modify this
|
||||
* attribute before you can terminate any "locked" instances from the APIs.
|
||||
*/
|
||||
boolean isApiTerminationDisabledForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
boolean isApiTerminationDisabledForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -311,7 +310,7 @@ public interface InstanceClient {
|
|||
* which instance to describe the attribute of
|
||||
* @return The instance type of the instance.
|
||||
*/
|
||||
String getInstanceTypeForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String getInstanceTypeForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -324,7 +323,7 @@ public interface InstanceClient {
|
|||
* is shut down.
|
||||
*/
|
||||
InstanceInitiatedShutdownBehavior getInstanceInitiatedShutdownBehaviorForInstanceInRegion(
|
||||
Region region, String instanceId);
|
||||
String region, String instanceId);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -336,7 +335,7 @@ public interface InstanceClient {
|
|||
* @return Describes the mapping that defines native device names to use when exposing virtual
|
||||
* devices.
|
||||
*/
|
||||
Map<String, EbsBlockDevice> getBlockDeviceMappingForInstanceInRegion(@Nullable Region region,
|
||||
Map<String, EbsBlockDevice> getBlockDeviceMappingForInstanceInRegion(@Nullable String region,
|
||||
String instanceId);
|
||||
|
||||
/**
|
||||
|
@ -349,7 +348,7 @@ public interface InstanceClient {
|
|||
* which instance to reset the attribute of
|
||||
* @return the ID of the RAM disk associated with the AMI.
|
||||
*/
|
||||
String resetRamdiskForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String resetRamdiskForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
* Resets an attribute of an instance to its default value.
|
||||
|
@ -361,7 +360,7 @@ public interface InstanceClient {
|
|||
* which instance to reset the attribute of
|
||||
* @return the ID of the kernel associated with the AMI.
|
||||
*/
|
||||
String resetKernelForInstanceInRegion(@Nullable Region region, String instanceId);
|
||||
String resetKernelForInstanceInRegion(@Nullable String region, String instanceId);
|
||||
|
||||
/**
|
||||
* Sets the userData used for starting the instance.
|
||||
|
@ -383,7 +382,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setUserDataForInstanceInRegion(@Nullable Region region, String instanceId, byte[] unencodedData);
|
||||
void setUserDataForInstanceInRegion(@Nullable String region, String instanceId, byte[] unencodedData);
|
||||
|
||||
/**
|
||||
* Sets the ramdisk used for starting the instance.
|
||||
|
@ -405,7 +404,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setRamdiskForInstanceInRegion(@Nullable Region region, String instanceId, String ramdisk);
|
||||
void setRamdiskForInstanceInRegion(@Nullable String region, String instanceId, String ramdisk);
|
||||
|
||||
/**
|
||||
* Sets the kernelId used for starting the instance.
|
||||
|
@ -427,7 +426,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setKernelForInstanceInRegion(@Nullable Region region, String instanceId, String kernel);
|
||||
void setKernelForInstanceInRegion(@Nullable String region, String instanceId, String kernel);
|
||||
|
||||
/**
|
||||
* This command works while the instance is running and controls whether or not the api can be
|
||||
|
@ -443,7 +442,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setApiTerminationDisabledForInstanceInRegion(@Nullable Region region, String instanceId,
|
||||
void setApiTerminationDisabledForInstanceInRegion(@Nullable String region, String instanceId,
|
||||
boolean apiTerminationDisabled);
|
||||
|
||||
/**
|
||||
|
@ -466,7 +465,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setInstanceTypeForInstanceInRegion(@Nullable Region region, String instanceId,
|
||||
void setInstanceTypeForInstanceInRegion(@Nullable String region, String instanceId,
|
||||
String instanceType);
|
||||
|
||||
/**
|
||||
|
@ -491,7 +490,7 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setInstanceInitiatedShutdownBehaviorForInstanceInRegion(@Nullable Region region, String instanceId,
|
||||
void setInstanceInitiatedShutdownBehaviorForInstanceInRegion(@Nullable String region, String instanceId,
|
||||
InstanceInitiatedShutdownBehavior instanceInitiatedShutdownBehavior);
|
||||
|
||||
/**
|
||||
|
@ -538,6 +537,6 @@ public interface InstanceClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html"
|
||||
* />
|
||||
*/
|
||||
void setBlockDeviceMappingForInstanceInRegion(@Nullable Region region, String instanceId,
|
||||
void setBlockDeviceMappingForInstanceInRegion(@Nullable String region, String instanceId,
|
||||
BlockDeviceMapping blockDeviceMapping);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public interface KeyPairAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "CreateKeyPair")
|
||||
@XMLResponseParser(KeyPairResponseHandler.class)
|
||||
ListenableFuture<KeyPair> createKeyPairInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("KeyName") String keyName);
|
||||
|
||||
// map resourcenotfoundexception to empty set
|
||||
|
@ -75,7 +75,7 @@ public interface KeyPairAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeKeyPairs")
|
||||
@XMLResponseParser(DescribeKeyPairsResponseHandler.class)
|
||||
ListenableFuture<? extends Set<KeyPair>> describeKeyPairsInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindKeyNameToIndexedFormParams.class) String... keyPairNames);
|
||||
|
||||
/**
|
||||
|
@ -85,7 +85,7 @@ public interface KeyPairAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "DeleteKeyPair")
|
||||
ListenableFuture<Void> deleteKeyPairInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("KeyName") String keyName);
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public interface KeyPairClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateKeyPair.html"
|
||||
* />
|
||||
*/
|
||||
KeyPair createKeyPairInRegion(@Nullable Region region, String keyName);
|
||||
KeyPair createKeyPairInRegion(@Nullable String region, String keyName);
|
||||
|
||||
/**
|
||||
* Returns information about key pairs available to you. If you specify key pairs, information
|
||||
|
@ -72,7 +72,7 @@ public interface KeyPairClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeKeyPairs.html"
|
||||
* />
|
||||
*/
|
||||
Set<KeyPair> describeKeyPairsInRegion(@Nullable Region region, String... keyPairNames);
|
||||
Set<KeyPair> describeKeyPairsInRegion(@Nullable String region, String... keyPairNames);
|
||||
|
||||
/**
|
||||
* Deletes the specified key pair, by removing the public key from Amazon EC2. You must own the
|
||||
|
@ -90,6 +90,6 @@ public interface KeyPairClient {
|
|||
* "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteKeyPair.html"
|
||||
* />
|
||||
*/
|
||||
void deleteKeyPairInRegion(@Nullable Region region, String keyName);
|
||||
void deleteKeyPairInRegion(@Nullable String region, String keyName);
|
||||
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public interface MonitoringAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "MonitorInstances")
|
||||
@XMLResponseParser(MonitoringStateHandler.class)
|
||||
ListenableFuture<? extends Map<String, MonitoringState>> monitorInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId.0") String instanceId,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
|
||||
|
@ -74,7 +74,7 @@ public interface MonitoringAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "UnmonitorInstances")
|
||||
@XMLResponseParser(MonitoringStateHandler.class)
|
||||
ListenableFuture<? extends Map<String, MonitoringState>> unmonitorInstancesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("InstanceId.0") String instanceId,
|
||||
@BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public interface MonitoringClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-MonitorInstances.html"
|
||||
* />
|
||||
*/
|
||||
Map<String, MonitoringState> monitorInstancesInRegion(@Nullable Region region, String instanceId,
|
||||
Map<String, MonitoringState> monitorInstancesInRegion(@Nullable String region, String instanceId,
|
||||
String... instanceIds);
|
||||
|
||||
/**
|
||||
|
@ -67,6 +67,6 @@ public interface MonitoringClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-UnmonitorInstances.html"
|
||||
* />
|
||||
*/
|
||||
Map<String, MonitoringState> unmonitorInstancesInRegion(@Nullable Region region, String instanceId,
|
||||
Map<String, MonitoringState> unmonitorInstancesInRegion(@Nullable String region, String instanceId,
|
||||
String... instanceIds);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "CreateSecurityGroup")
|
||||
ListenableFuture<Void> createSecurityGroupInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("GroupName") String name, @FormParam("GroupDescription") String description);
|
||||
|
||||
/**
|
||||
|
@ -77,7 +77,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DeleteSecurityGroup")
|
||||
@ExceptionParser(ReturnVoidOnGroupNotFound.class)
|
||||
ListenableFuture<Void> deleteSecurityGroupInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("GroupName") String name);
|
||||
|
||||
/**
|
||||
|
@ -88,7 +88,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "DescribeSecurityGroups")
|
||||
@XMLResponseParser(DescribeSecurityGroupsResponseHandler.class)
|
||||
ListenableFuture<? extends SortedSet<SecurityGroup>> describeSecurityGroupsInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@BinderParam(BindGroupNameToIndexedFormParams.class) String... securityGroupNames);
|
||||
|
||||
/**
|
||||
|
@ -98,7 +98,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "AuthorizeSecurityGroupIngress")
|
||||
ListenableFuture<Void> authorizeSecurityGroupIngressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("GroupName") String groupName,
|
||||
@BinderParam(BindUserIdGroupPairToSourceSecurityGroupFormParams.class) UserIdGroupPair sourceSecurityGroup);
|
||||
|
||||
|
@ -110,7 +110,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "AuthorizeSecurityGroupIngress")
|
||||
ListenableFuture<Void> authorizeSecurityGroupIngressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("GroupName") String groupName,
|
||||
@FormParam("IpProtocol") IpProtocol ipProtocol, @FormParam("FromPort") int fromPort,
|
||||
@FormParam("ToPort") int toPort, @FormParam("CidrIp") String cidrIp);
|
||||
|
@ -122,7 +122,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "RevokeSecurityGroupIngress")
|
||||
ListenableFuture<Void> revokeSecurityGroupIngressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("GroupName") String groupName,
|
||||
@BinderParam(BindUserIdGroupPairToSourceSecurityGroupFormParams.class) UserIdGroupPair sourceSecurityGroup);
|
||||
|
||||
|
@ -134,7 +134,7 @@ public interface SecurityGroupAsyncClient {
|
|||
@Path("/")
|
||||
@FormParams(keys = ACTION, values = "RevokeSecurityGroupIngress")
|
||||
ListenableFuture<Void> revokeSecurityGroupIngressInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("GroupName") String groupName,
|
||||
@FormParam("IpProtocol") IpProtocol ipProtocol, @FormParam("FromPort") int fromPort,
|
||||
@FormParam("ToPort") int toPort, @FormParam("CidrIp") String cidrIp);
|
||||
|
|
|
@ -61,7 +61,7 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-CreateSecurityGroup.html"
|
||||
* />
|
||||
*/
|
||||
void createSecurityGroupInRegion(@Nullable Region region, String name, String description);
|
||||
void createSecurityGroupInRegion(@Nullable String region, String name, String description);
|
||||
|
||||
/**
|
||||
* Deletes a security group that you own.
|
||||
|
@ -81,7 +81,7 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSecurityGroup.html"
|
||||
* />
|
||||
*/
|
||||
void deleteSecurityGroupInRegion(@Nullable Region region, String name);
|
||||
void deleteSecurityGroupInRegion(@Nullable String region, String name);
|
||||
|
||||
/**
|
||||
* Returns information about security groups that you own.
|
||||
|
@ -101,7 +101,7 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSecurityGroups.html"
|
||||
* />
|
||||
*/
|
||||
SortedSet<SecurityGroup> describeSecurityGroupsInRegion(@Nullable Region region,
|
||||
SortedSet<SecurityGroup> describeSecurityGroupsInRegion(@Nullable String region,
|
||||
String... securityGroupNames);
|
||||
|
||||
/**
|
||||
|
@ -125,7 +125,7 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-AuthorizeSecurityGroupIngress.html"
|
||||
*
|
||||
*/
|
||||
void authorizeSecurityGroupIngressInRegion(@Nullable Region region, String groupName,
|
||||
void authorizeSecurityGroupIngressInRegion(@Nullable String region, String groupName,
|
||||
UserIdGroupPair sourceSecurityGroup);
|
||||
|
||||
/**
|
||||
|
@ -164,7 +164,7 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-AuthorizeSecurityGroupIngress.html"
|
||||
*
|
||||
*/
|
||||
void authorizeSecurityGroupIngressInRegion(@Nullable Region region, String groupName,
|
||||
void authorizeSecurityGroupIngressInRegion(@Nullable String region, String groupName,
|
||||
IpProtocol ipProtocol, int fromPort, int toPort, String cidrIp);
|
||||
|
||||
/**
|
||||
|
@ -189,7 +189,7 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-RevokeSecurityGroupIngress.html"
|
||||
*
|
||||
*/
|
||||
void revokeSecurityGroupIngressInRegion(@Nullable Region region, String groupName,
|
||||
void revokeSecurityGroupIngressInRegion(@Nullable String region, String groupName,
|
||||
UserIdGroupPair sourceSecurityGroup);
|
||||
|
||||
/**
|
||||
|
@ -229,6 +229,6 @@ public interface SecurityGroupClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-RevokeSecurityGroupIngress.html"
|
||||
*
|
||||
*/
|
||||
void revokeSecurityGroupIngressInRegion(@Nullable Region region, String groupName, IpProtocol ipProtocol,
|
||||
void revokeSecurityGroupIngressInRegion(@Nullable String region, String groupName, IpProtocol ipProtocol,
|
||||
int fromPort, int toPort, String cidrIp);
|
||||
}
|
||||
|
|
|
@ -55,10 +55,16 @@ public class EC2Utils {
|
|||
}
|
||||
}
|
||||
|
||||
public static Region findRegionInArgsOrNull(GeneratedHttpRequest<?> gRequest) {
|
||||
public static String findRegionInArgsOrNull(GeneratedHttpRequest<?> gRequest) {
|
||||
for (Object arg : gRequest.getArgs()) {
|
||||
if (arg instanceof Region) {
|
||||
return (Region) arg;
|
||||
if (arg instanceof String) {
|
||||
String regionName = (String) arg;
|
||||
if(Region.EU_WEST_1.equals(regionName) ||
|
||||
Region.US_WEST_1.equals(regionName) ||
|
||||
Region.US_EAST_1.equals(regionName) ||
|
||||
Region.US_STANDARD.equals(regionName) ||
|
||||
Region.AP_SOUTHEAST_1.equals(regionName)
|
||||
) return regionName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -44,7 +44,7 @@ public class AttachmentHandler extends ParseSax.HandlerWithResult<Attachment> {
|
|||
protected DateService dateService;
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
private String volumeId;
|
||||
private String instanceId;
|
||||
private String device;
|
||||
|
@ -52,7 +52,7 @@ public class AttachmentHandler extends ParseSax.HandlerWithResult<Attachment> {
|
|||
private Date attachTime;
|
||||
|
||||
public Attachment getResult() {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
return new Attachment(region, volumeId, instanceId, device, attachmentStatus, attachTime);
|
||||
|
|
|
@ -54,10 +54,10 @@ public abstract class BaseReservationHandler<T> extends HandlerWithResult<T> {
|
|||
|
||||
protected final DateService dateService;
|
||||
|
||||
protected final Region defaultRegion;
|
||||
protected final String defaultRegion;
|
||||
|
||||
@Inject
|
||||
public BaseReservationHandler(DateService dateService, @EC2 Region defaultRegion) {
|
||||
public BaseReservationHandler(DateService dateService, @EC2 String defaultRegion) {
|
||||
this.dateService = dateService;
|
||||
this.defaultRegion = defaultRegion;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ public abstract class BaseReservationHandler<T> extends HandlerWithResult<T> {
|
|||
this.attachTime = null;
|
||||
this.deleteOnTermination = true;
|
||||
} else if (inInstances && !inProductCodes && !inBlockDeviceMapping) {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
instances.add(new RunningInstance(region, amiLaunchIndex, dnsName, imageId, instanceId,
|
||||
|
@ -261,7 +261,7 @@ public abstract class BaseReservationHandler<T> extends HandlerWithResult<T> {
|
|||
}
|
||||
|
||||
protected Reservation newReservation() {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
Reservation info = new Reservation(region, groupIds, instances, ownerId, requesterId,
|
||||
|
|
|
@ -54,9 +54,9 @@ public class CreateVolumeResponseHandler extends ParseSax.HandlerWithResult<Volu
|
|||
protected DateService dateService;
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
@Inject
|
||||
protected Map<AvailabilityZone, Region> availabilityZoneToRegion;
|
||||
protected Map<AvailabilityZone, String> availabilityZoneToRegion;
|
||||
|
||||
private String id;
|
||||
private int size;
|
||||
|
@ -74,7 +74,7 @@ public class CreateVolumeResponseHandler extends ParseSax.HandlerWithResult<Volu
|
|||
|
||||
private boolean inAttachmentSet;
|
||||
|
||||
private Region region;
|
||||
private String region;
|
||||
|
||||
public Volume getResult() {
|
||||
return newVolume();
|
||||
|
|
|
@ -48,7 +48,7 @@ public class DescribeAddressesResponseHandler extends
|
|||
private StringBuilder currentText = new StringBuilder();
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
private String instanceId;
|
||||
|
||||
protected String currentOrNull() {
|
||||
|
@ -62,7 +62,7 @@ public class DescribeAddressesResponseHandler extends
|
|||
} else if (qName.equals("instanceId")) {
|
||||
instanceId = currentOrNull();
|
||||
} else if (qName.equals("item")) {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
pairs.add(new PublicIpInstanceIdPair(region, ipAddress, instanceId));
|
||||
|
|
|
@ -44,7 +44,7 @@ public class DescribeAvailabilityZonesResponseHandler extends
|
|||
private AvailabilityZone zone;
|
||||
@Resource
|
||||
protected Logger logger = Logger.NULL;
|
||||
private Region region;
|
||||
private String region;
|
||||
private String zoneName;
|
||||
private State zoneState;
|
||||
private boolean inMessageSet;
|
||||
|
@ -71,10 +71,10 @@ public class DescribeAvailabilityZonesResponseHandler extends
|
|||
}
|
||||
} else if (qName.equals("regionName")) {
|
||||
try {
|
||||
region = Region.fromValue(currentText.toString().trim());
|
||||
region = currentText.toString().trim();
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.warn(e, "unsupported region: %s", currentText.toString().trim());
|
||||
region = Region.UNKNOWN;
|
||||
region = "UNKNOWN";
|
||||
}
|
||||
} else if (qName.equals("zoneState")) {
|
||||
try {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class DescribeImagesResponseHandler extends ParseSax.HandlerWithResult<Se
|
|||
protected Logger logger = Logger.NULL;
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
private Set<Image> contents = Sets.newLinkedHashSet();
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class DescribeImagesResponseHandler extends ParseSax.HandlerWithResult<Se
|
|||
this.deleteOnTermination = true;
|
||||
} else if (!inProductCodes) {
|
||||
try {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
contents.add(new Image(region, architecture,
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DescribeInstancesResponseHandler extends
|
|||
private SortedSet<Reservation> reservations = Sets.newTreeSet();
|
||||
|
||||
@Inject
|
||||
DescribeInstancesResponseHandler(DateService dateService, @EC2 Region defaultRegion) {
|
||||
DescribeInstancesResponseHandler(DateService dateService, @EC2 String defaultRegion) {
|
||||
super(dateService, defaultRegion);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import com.google.common.collect.Sets;
|
|||
public class DescribeKeyPairsResponseHandler extends ParseSax.HandlerWithResult<Set<KeyPair>> {
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
private Set<KeyPair> keyPairs = Sets.newLinkedHashSet();
|
||||
|
@ -56,7 +56,7 @@ public class DescribeKeyPairsResponseHandler extends ParseSax.HandlerWithResult<
|
|||
if (qName.equals("keyFingerprint")) {
|
||||
this.keyFingerprint = currentText.toString().trim();
|
||||
} else if (qName.equals("item")) {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
keyPairs.add(new KeyPair(region, keyName, keyFingerprint, null));
|
||||
|
|
|
@ -33,27 +33,22 @@ import com.google.common.collect.Maps;
|
|||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class DescribeRegionsResponseHandler extends ParseSax.HandlerWithResult<Map<Region, URI>> {
|
||||
public class DescribeRegionsResponseHandler extends ParseSax.HandlerWithResult<Map<String, URI>> {
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
|
||||
private Map<Region, URI> regionEndpoints = Maps.newHashMap();
|
||||
private Region region;
|
||||
private Map<String, URI> regionEndpoints = Maps.newHashMap();
|
||||
private String region;
|
||||
private URI regionEndpoint;
|
||||
@Resource
|
||||
protected Logger logger = Logger.NULL;
|
||||
|
||||
public Map<Region, URI> getResult() {
|
||||
public Map<String, URI> getResult() {
|
||||
return regionEndpoints;
|
||||
}
|
||||
|
||||
public void endElement(String uri, String name, String qName) {
|
||||
if (qName.equals("regionName")) {
|
||||
try {
|
||||
region = Region.fromValue(currentText.toString().trim());
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.warn(e, "unsupported region: %s", currentText.toString().trim());
|
||||
region = Region.UNKNOWN;
|
||||
}
|
||||
region = currentText.toString().trim();
|
||||
} else if (qName.equals("regionEndpoint")) {
|
||||
regionEndpoint = URI.create(String.format("https://%s", currentText.toString().trim()));
|
||||
} else if (qName.equals("item")) {
|
||||
|
|
|
@ -45,7 +45,7 @@ public class DescribeSecurityGroupsResponseHandler extends
|
|||
ParseSax.HandlerWithResult<SortedSet<SecurityGroup>> {
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
private SortedSet<SecurityGroup> securtyGroups = Sets.newTreeSet();
|
||||
|
@ -118,7 +118,7 @@ public class DescribeSecurityGroupsResponseHandler extends
|
|||
this.userId = null;
|
||||
this.userIdGroupName = null;
|
||||
} else if (!inIpPermissions && !inIpRanges && !inGroups) {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
securtyGroups.add(new SecurityGroup(region, groupName, ownerId, groupDescription,
|
||||
|
|
|
@ -51,7 +51,7 @@ public class InstanceStateChangeHandler extends HandlerWithResult<SortedSet<Inst
|
|||
private StringBuilder currentText = new StringBuilder();
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
|
||||
SortedSet<InstanceStateChange> instances = Sets.newTreeSet();
|
||||
private InstanceState shutdownState;
|
||||
|
@ -90,7 +90,7 @@ public class InstanceStateChangeHandler extends HandlerWithResult<SortedSet<Inst
|
|||
previousState = InstanceState.fromValue(currentOrNull());
|
||||
}
|
||||
} else if (qName.equals("item")) {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
instances.add(new InstanceStateChange(region, instanceId, shutdownState, previousState));
|
||||
|
|
|
@ -36,14 +36,14 @@ import org.jclouds.http.functions.ParseSax;
|
|||
public class KeyPairResponseHandler extends ParseSax.HandlerWithResult<KeyPair> {
|
||||
@Inject
|
||||
@EC2
|
||||
Region defaultRegion;
|
||||
String defaultRegion;
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
private String keyFingerprint;
|
||||
private String keyMaterial;
|
||||
private String keyName;
|
||||
|
||||
public KeyPair getResult() {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
return new KeyPair(region, keyName, keyFingerprint, keyMaterial);
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.jclouds.date.DateService;
|
|||
public class RunInstancesResponseHandler extends BaseReservationHandler<Reservation> {
|
||||
|
||||
@Inject
|
||||
RunInstancesResponseHandler(DateService dateService, @EC2 Region defaultRegion) {
|
||||
RunInstancesResponseHandler(DateService dateService, @EC2 String defaultRegion) {
|
||||
super(dateService, defaultRegion);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SnapshotHandler extends ParseSax.HandlerWithResult<Snapshot> {
|
|||
private StringBuilder currentText = new StringBuilder();
|
||||
|
||||
protected final DateService dateService;
|
||||
protected final Region defaultRegion;
|
||||
protected final String defaultRegion;
|
||||
|
||||
private String id;
|
||||
private String volumeId;
|
||||
|
@ -51,13 +51,13 @@ public class SnapshotHandler extends ParseSax.HandlerWithResult<Snapshot> {
|
|||
private String ownerAlias;
|
||||
|
||||
@Inject
|
||||
public SnapshotHandler(DateService dateService, @EC2 Region defaultRegion) {
|
||||
public SnapshotHandler(DateService dateService, @EC2 String defaultRegion) {
|
||||
this.dateService = dateService;
|
||||
this.defaultRegion = defaultRegion;
|
||||
}
|
||||
|
||||
public Snapshot getResult() {
|
||||
Region region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
String region = EC2Utils.findRegionInArgsOrNull(request);
|
||||
if (region == null)
|
||||
region = defaultRegion;
|
||||
Snapshot snapshot = new Snapshot(region, id, volumeId, volumeSize, status, startTime,
|
||||
|
|
|
@ -31,7 +31,6 @@ import javax.ws.rs.PUT;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.s3.binders.BindACLToXMLPayload;
|
||||
import org.jclouds.aws.s3.binders.BindBucketLoggingToXmlPayload;
|
||||
import org.jclouds.aws.s3.binders.BindNoBucketLoggingToXmlPayload;
|
||||
|
@ -167,7 +166,7 @@ public interface S3AsyncClient {
|
|||
@ExceptionParser(ReturnFalseIfBucketAlreadyOwnedByYou.class)
|
||||
ListenableFuture<Boolean> putBucketInRegion(
|
||||
// TODO endpoint based on region
|
||||
@BinderParam(BindRegionToXmlPayload.class) @Nullable Region region,
|
||||
@BinderParam(BindRegionToXmlPayload.class) @Nullable String region,
|
||||
@HostPrefixParam String bucketName, PutBucketOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -194,7 +193,7 @@ public interface S3AsyncClient {
|
|||
@QueryParams(keys = "location")
|
||||
@Path("/")
|
||||
@XMLResponseParser(LocationConstraintHandler.class)
|
||||
ListenableFuture<Region> getBucketLocation(@HostPrefixParam String bucketName);
|
||||
ListenableFuture<String> getBucketLocation(@HostPrefixParam String bucketName);
|
||||
|
||||
/**
|
||||
* @see S3Client#getBucketPayer
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.s3.domain.AccessControlList;
|
||||
import org.jclouds.aws.s3.domain.BucketLogging;
|
||||
import org.jclouds.aws.s3.domain.BucketMetadata;
|
||||
|
@ -196,7 +195,7 @@ public interface S3Client {
|
|||
*
|
||||
*/
|
||||
@Timeout(duration = 90, timeUnit = TimeUnit.SECONDS)
|
||||
boolean putBucketInRegion(@Nullable Region region, String bucketName, PutBucketOptions... options);
|
||||
boolean putBucketInRegion(@Nullable String region, String bucketName, PutBucketOptions... options);
|
||||
|
||||
/**
|
||||
* Deletes the bucket, if it is empty.
|
||||
|
@ -359,7 +358,7 @@ public interface S3Client {
|
|||
* "http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTBucketLocationGET.html"
|
||||
* />
|
||||
*/
|
||||
Region getBucketLocation(String bucketName);
|
||||
String getBucketLocation(String bucketName);
|
||||
|
||||
/**
|
||||
* A GET request operation on a requestPayment resource returns the request payment configuration
|
||||
|
|
|
@ -137,14 +137,14 @@ public class S3AsyncBlobStore extends BaseAsyncBlobStore {
|
|||
* This implementation invokes {@link S3AsyncClient#putBucketInRegion}
|
||||
*
|
||||
* @param location
|
||||
* corresponds to {@link Region#fromValue}
|
||||
* corresponds to {@link Region}
|
||||
* @param container
|
||||
* bucket name
|
||||
*/
|
||||
@Override
|
||||
public ListenableFuture<Boolean> createContainerInLocation(Location location, String container) {
|
||||
location = location != null ? location : defaultLocation;
|
||||
return async.putBucketInRegion(Region.fromValue(location.getId()), container);
|
||||
return async.putBucketInRegion(location.getId(), container);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -132,7 +132,7 @@ public class S3BlobStore extends BaseBlobStore {
|
|||
@Override
|
||||
public boolean createContainerInLocation(Location location, String container) {
|
||||
location = location != null ? location : defaultLocation;
|
||||
return sync.putBucketInRegion(Region.fromValue(location.getId()), container);
|
||||
return sync.putBucketInRegion(location.getId(), container);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,15 +68,15 @@ public class S3BlobStoreContextModule extends S3ContextModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
Location getDefaultLocation(@S3 Region region, Map<String, ? extends Location> locations) {
|
||||
Location getDefaultLocation(@S3 String region, Map<String, ? extends Location> locations) {
|
||||
return locations.get(region.toString());
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Map<String, ? extends Location> provideLocations(@S3 Set<Region> regions) {
|
||||
Map<String, ? extends Location> provideLocations(@S3 Set<String> regions) {
|
||||
Set<Location> locations = Sets.newHashSet();
|
||||
for (Region zone : regions) {
|
||||
for (String zone : regions) {
|
||||
locations
|
||||
.add(new LocationImpl(LocationScope.ZONE, zone.toString(), zone.toString(), null));
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class BucketToResourceMetadata implements Function<BucketMetadata, Storag
|
|||
to.setName(from.getName());
|
||||
to.setType(StorageType.CONTAINER);
|
||||
try {
|
||||
Region region = client.getBucketLocation(from.getName());
|
||||
String region = client.getBucketLocation(from.getName());
|
||||
if (region != null) {
|
||||
Location location = locations.get(region.toString());
|
||||
if (location == null)
|
||||
|
|
|
@ -102,18 +102,18 @@ public class S3RestClientModule extends AbstractModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@S3
|
||||
Map<Region, URI> provideRegions(
|
||||
Map<String, URI> provideRegions(
|
||||
@Named(S3Constants.PROPERTY_S3_ENDPOINT_US_STANDARD) String usstandard,
|
||||
@Named(S3Constants.PROPERTY_S3_ENDPOINT_US_WEST_1) String uswest,
|
||||
@Named(S3Constants.PROPERTY_S3_ENDPOINT_EU_WEST_1) String euwest) {
|
||||
return ImmutableMap.<Region, URI> of(Region.US_STANDARD, URI.create(usstandard),
|
||||
return ImmutableMap.<String, URI> of(Region.US_STANDARD, URI.create(usstandard),
|
||||
Region.US_WEST_1, URI.create(uswest), Region.EU_WEST_1, URI.create(euwest));
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@S3
|
||||
Set<Region> provideRegions(@S3 Map<Region, URI> map) {
|
||||
Set<String> provideRegions(@S3 Map<String, URI> map) {
|
||||
return map.keySet();
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,8 @@ public class S3RestClientModule extends AbstractModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@S3
|
||||
Region getDefaultRegion(@S3 URI uri, @S3 Map<Region, URI> map) {
|
||||
return ImmutableBiMap.<Region, URI> builder().putAll(map).build().inverse().get(uri);
|
||||
String getDefaultRegion(@S3 URI uri, @S3 Map<String, URI> map) {
|
||||
return ImmutableBiMap.<String, URI> builder().putAll(map).build().inverse().get(uri);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -40,31 +40,25 @@ import org.jclouds.rest.binders.BindToStringPayload;
|
|||
@Singleton
|
||||
public class BindRegionToXmlPayload extends BindToStringPayload {
|
||||
|
||||
private final Region defaultRegion;
|
||||
private final String defaultRegion;
|
||||
|
||||
@Inject
|
||||
BindRegionToXmlPayload(@S3 Region defaultRegion) {
|
||||
BindRegionToXmlPayload(@S3 String defaultRegion) {
|
||||
this.defaultRegion = defaultRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindToRequest(HttpRequest request, Object input) {
|
||||
input = input == null ? defaultRegion : input;
|
||||
checkArgument(input instanceof Region, "this binder is only valid for Region!");
|
||||
Region constraint = (Region) input;
|
||||
checkArgument(input instanceof String, "this binder is only valid for Region!");
|
||||
String constraint = (String) input;
|
||||
String value = null;
|
||||
switch (constraint) {
|
||||
case US_STANDARD:
|
||||
case US_EAST_1:
|
||||
// nothing to bind as this is default.
|
||||
return;
|
||||
case EU_WEST_1:
|
||||
value = "EU";
|
||||
break;
|
||||
case US_WEST_1:
|
||||
value = "us-west-1";
|
||||
break;
|
||||
default:
|
||||
if(Region.US_STANDARD.equals(constraint) || Region.US_EAST_1.equals(constraint)) {
|
||||
// nothing to bind as this is default.
|
||||
return;
|
||||
} else if(Region.EU_WEST_1.equals(constraint)) value = "EU";
|
||||
else if(Region.US_WEST_1.equals(constraint)) value = "us-west-1";
|
||||
else {
|
||||
throw new IllegalStateException("unimplemented location: " + this);
|
||||
}
|
||||
String payload = String
|
||||
|
|
|
@ -29,11 +29,11 @@ import org.jclouds.http.functions.ParseSax;
|
|||
* @see <a href= "http://docs.amazonwebservices.com/AmazonS3/latest/RESTBucketLocationGET.html" />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class LocationConstraintHandler extends ParseSax.HandlerWithResult<Region> {
|
||||
public class LocationConstraintHandler extends ParseSax.HandlerWithResult<String> {
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
private Region region;
|
||||
private String region;
|
||||
|
||||
public Region getResult() {
|
||||
public String getResult() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class LocationConstraintHandler extends ParseSax.HandlerWithResult<Region
|
|||
* <p/>
|
||||
* {@code US_STANDARD} is returned as "" xml documents.
|
||||
*/
|
||||
public static Region fromValue(String v) {
|
||||
public static String fromValue(String v) {
|
||||
if (v.equals(""))
|
||||
return Region.US_STANDARD;
|
||||
if (v.equals("EU"))
|
||||
|
|
|
@ -65,7 +65,7 @@ public interface SQSAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "ListQueues")
|
||||
@ResponseParser(RegexListQueuesResponseHandler.class)
|
||||
ListenableFuture<? extends Set<Queue>> listQueuesInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
ListQueuesOptions... options);
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ public interface SQSAsyncClient {
|
|||
@FormParams(keys = ACTION, values = "CreateQueue")
|
||||
@ResponseParser(RegexQueueHandler.class)
|
||||
ListenableFuture<Queue> createQueueInRegion(
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable Region region,
|
||||
@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
|
||||
@FormParam("QueueName") String queueName, CreateQueueOptions... options);
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,7 +51,7 @@ public interface SQSClient {
|
|||
* @see <a href="http://docs.amazonwebservices.com/AWSSimpleQueueService/2009-02-01/APIReference/Query_QueryListQueues.html"
|
||||
* />
|
||||
*/
|
||||
Set<Queue> listQueuesInRegion(@Nullable Region region, ListQueuesOptions... options);
|
||||
Set<Queue> listQueuesInRegion(@Nullable String region, ListQueuesOptions... options);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -81,7 +81,7 @@ public interface SQSClient {
|
|||
* @param options
|
||||
* like the visibility timeout (in seconds) to use for this queue.
|
||||
*/
|
||||
Queue createQueueInRegion(@Nullable Region region, String queueName, CreateQueueOptions... options);
|
||||
Queue createQueueInRegion(@Nullable String region, String queueName, CreateQueueOptions... options);
|
||||
|
||||
/**
|
||||
* The DeleteQueue action deletes the queue specified by the queue URL, regardless of whether the
|
||||
|
|
|
@ -91,11 +91,11 @@ public class SQSRestClientModule extends AbstractModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@SQS
|
||||
Map<Region, URI> provideRegions(
|
||||
Map<String, URI> provideRegions(
|
||||
@Named(SQSConstants.PROPERTY_SQS_ENDPOINT_US_EAST_1) String useast,
|
||||
@Named(SQSConstants.PROPERTY_SQS_ENDPOINT_US_WEST_1) String uswest,
|
||||
@Named(SQSConstants.PROPERTY_SQS_ENDPOINT_EU_WEST_1) String euwest) {
|
||||
return ImmutableMap.<Region, URI> of(Region.US_EAST_1, URI.create(useast), Region.US_WEST_1,
|
||||
return ImmutableMap.<String, URI> of(Region.US_EAST_1, URI.create(useast), Region.US_WEST_1,
|
||||
URI.create(uswest), Region.EU_WEST_1, URI.create(euwest));
|
||||
}
|
||||
|
||||
|
@ -109,8 +109,8 @@ public class SQSRestClientModule extends AbstractModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@SQS
|
||||
Region getDefaultRegion(@SQS URI uri, @SQS Map<Region, URI> map) {
|
||||
return ImmutableBiMap.<Region, URI> builder().putAll(map).build().inverse().get(uri);
|
||||
String getDefaultRegion(@SQS URI uri, @SQS Map<String, URI> map) {
|
||||
return ImmutableBiMap.<String, URI> builder().putAll(map).build().inverse().get(uri);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -31,11 +31,11 @@ import org.jclouds.aws.domain.Region;
|
|||
* @author Adrian Cole
|
||||
*/
|
||||
public class Queue implements Comparable<Queue> {
|
||||
private final Region region;
|
||||
private final String region;
|
||||
private final String name;
|
||||
private final URI location;
|
||||
|
||||
public Queue(Region region, String name, URI location) {
|
||||
public Queue(String region, String name, URI location) {
|
||||
this.region = checkNotNull(region,"region");
|
||||
this.location = checkNotNull(location, "location");
|
||||
this.name = checkNotNull(name, "name");
|
||||
|
@ -46,7 +46,7 @@ public class Queue implements Comparable<Queue> {
|
|||
return location.toASCIIString().compareTo(o.location.toASCIIString());
|
||||
}
|
||||
|
||||
public Region getRegion() {
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,11 +35,11 @@ import com.google.common.base.Function;
|
|||
*/
|
||||
@Singleton
|
||||
public class RegionToEndpoint implements Function<Object, URI> {
|
||||
private final Map<Region, URI> regionToEndpoint;
|
||||
private final Map<String, URI> regionToEndpoint;
|
||||
private final URI defaultUri;
|
||||
|
||||
@Inject
|
||||
public RegionToEndpoint(@SQS Map<Region, URI> regionToEndpoint, @SQS URI defaultUri) {
|
||||
public RegionToEndpoint(@SQS Map<String, URI> regionToEndpoint, @SQS URI defaultUri) {
|
||||
this.regionToEndpoint = regionToEndpoint;
|
||||
this.defaultUri = defaultUri;
|
||||
}
|
||||
|
|
|
@ -43,13 +43,13 @@ public class QueueHandler extends ParseSax.HandlerWithResult<Queue> {
|
|||
private StringBuilder currentText = new StringBuilder();
|
||||
Queue queue;
|
||||
|
||||
private final ImmutableBiMap<Region, URI> regionBiMap;
|
||||
private final ImmutableBiMap<String, URI> regionBiMap;
|
||||
private final Provider<UriBuilder> uriBuilderProvider;
|
||||
|
||||
@Inject
|
||||
QueueHandler(Provider<UriBuilder> uriBuilderProvider, @SQS Map<Region, URI> regionMap) {
|
||||
QueueHandler(Provider<UriBuilder> uriBuilderProvider, @SQS Map<String, URI> regionMap) {
|
||||
this.uriBuilderProvider = uriBuilderProvider;
|
||||
this.regionBiMap = ImmutableBiMap.<Region, URI> builder().putAll(regionMap).build();
|
||||
this.regionBiMap = ImmutableBiMap.<String, URI> builder().putAll(regionMap).build();
|
||||
}
|
||||
|
||||
public Queue getResult() {
|
||||
|
@ -63,7 +63,7 @@ public class QueueHandler extends ParseSax.HandlerWithResult<Queue> {
|
|||
String queueName = uriText.substring(uriText.lastIndexOf('/') + 1);
|
||||
URI location = URI.create(uriText);
|
||||
URI regionURI = uriBuilderProvider.get().uri(location).replacePath("").build();
|
||||
Region region = regionBiMap.inverse().get(regionURI);
|
||||
String region = regionBiMap.inverse().get(regionURI);
|
||||
this.queue = new Queue(region, queueName, location);
|
||||
}
|
||||
currentText = new StringBuilder();
|
||||
|
|
|
@ -46,7 +46,7 @@ import com.google.common.base.Throwables;
|
|||
public class RegexListQueuesResponseHandler extends BaseRegexQueueHandler implements
|
||||
Function<HttpResponse, Set<Queue>> {
|
||||
@Inject
|
||||
RegexListQueuesResponseHandler(@SQS Map<Region, URI> regionMap) {
|
||||
RegexListQueuesResponseHandler(@SQS Map<String, URI> regionMap) {
|
||||
super(regionMap);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import com.google.inject.internal.Iterables;
|
|||
public class RegexQueueHandler extends BaseRegexQueueHandler implements
|
||||
Function<HttpResponse, Queue> {
|
||||
@Inject
|
||||
RegexQueueHandler(@SQS Map<Region, URI> regionMap) {
|
||||
RegexQueueHandler(@SQS Map<String, URI> regionMap) {
|
||||
super(regionMap);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ import com.google.common.collect.Sets;
|
|||
*/
|
||||
@Singleton
|
||||
public class BaseRegexQueueHandler {
|
||||
private final ImmutableBiMap<URI, Region> uriToRegion;
|
||||
private final ImmutableBiMap<URI, String> uriToRegion;
|
||||
Pattern pattern = Pattern.compile("<QueueUrl>(https://[\\S&&[^<]]+)</QueueUrl>");
|
||||
|
||||
@Inject
|
||||
protected BaseRegexQueueHandler(Map<Region, URI> regionMap) {
|
||||
this.uriToRegion = ImmutableBiMap.<Region, URI> builder().putAll(regionMap).build().inverse();
|
||||
protected BaseRegexQueueHandler(Map<String, URI> regionMap) {
|
||||
this.uriToRegion = ImmutableBiMap.<String, URI> builder().putAll(regionMap).build().inverse();
|
||||
}
|
||||
|
||||
public Set<Queue> parse(String in) {
|
||||
|
@ -58,7 +58,7 @@ public class BaseRegexQueueHandler {
|
|||
URI location = URI.create(uriText);
|
||||
String regionString = uriText.substring(0, uriText.indexOf(".com/") + 4);
|
||||
URI regionURI = URI.create(regionString);
|
||||
Region region = uriToRegion.get(regionURI);
|
||||
String region = uriToRegion.get(regionURI);
|
||||
queues.add(new Queue(region, queueName, location));
|
||||
}
|
||||
return queues;
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.io.IOException;
|
|||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.options.CreateImageOptions;
|
||||
import org.jclouds.aws.ec2.options.DescribeImagesOptions;
|
||||
import org.jclouds.aws.ec2.options.RegisterImageBackedByEbsOptions;
|
||||
|
@ -52,7 +51,7 @@ import com.google.inject.TypeLiteral;
|
|||
public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
||||
|
||||
public void testCreateImage() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("createImageInRegion", Region.class,
|
||||
Method method = AMIAsyncClient.class.getMethod("createImageInRegion", String.class,
|
||||
String.class, String.class, Array.newInstance(CreateImageOptions.class, 0)
|
||||
.getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
|
@ -72,7 +71,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
|
||||
public void testCreateImageOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("createImageInRegion", Region.class,
|
||||
Method method = AMIAsyncClient.class.getMethod("createImageInRegion", String.class,
|
||||
String.class, String.class, Array.newInstance(CreateImageOptions.class, 0)
|
||||
.getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
|
@ -94,10 +93,10 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
}
|
||||
|
||||
public void testDescribeImages() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("describeImagesInRegion", Region.class, Array
|
||||
Method method = AMIAsyncClient.class.getMethod("describeImagesInRegion", String.class, Array
|
||||
.newInstance(DescribeImagesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method,
|
||||
(Region) null);
|
||||
(String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -117,7 +116,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
|
||||
public void testDescribeImagesOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("describeImagesInRegion", Region.class, Array
|
||||
Method method = AMIAsyncClient.class.getMethod("describeImagesInRegion", String.class, Array
|
||||
.newInstance(DescribeImagesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
executableBy("me").ownedBy("fred", "nancy").imageIds("1", "2"));
|
||||
|
@ -137,7 +136,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
}
|
||||
|
||||
public void testDeregisterImage() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("deregisterImageInRegion", Region.class,
|
||||
Method method = AMIAsyncClient.class.getMethod("deregisterImageInRegion", String.class,
|
||||
String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageId");
|
||||
|
@ -157,7 +156,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testRegisterImageFromManifest() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("registerImageFromManifestInRegion",
|
||||
Region.class, String.class, String.class, Array.newInstance(
|
||||
String.class, String.class, String.class, Array.newInstance(
|
||||
RegisterImageOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"name", "pathToManifest");
|
||||
|
@ -177,7 +176,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testRegisterImageFromManifestOptions() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("registerImageFromManifestInRegion",
|
||||
Region.class, String.class, String.class, Array.newInstance(
|
||||
String.class, String.class, String.class, Array.newInstance(
|
||||
RegisterImageOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"name", "pathToManifest", new RegisterImageOptions().withDescription("description"));
|
||||
|
@ -199,7 +198,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testRegisterImageBackedByEBS() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("registerUnixImageBackedByEbsInRegion",
|
||||
Region.class, String.class, String.class, Array.newInstance(
|
||||
String.class, String.class, String.class, Array.newInstance(
|
||||
RegisterImageBackedByEbsOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageName", "snapshotId");
|
||||
|
@ -220,7 +219,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testRegisterImageBackedByEBSOptions() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("registerUnixImageBackedByEbsInRegion",
|
||||
Region.class, String.class, String.class, Array.newInstance(
|
||||
String.class, String.class, String.class, Array.newInstance(
|
||||
RegisterImageBackedByEbsOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageName", "snapshotId", new RegisterImageBackedByEbsOptions().withDescription(
|
||||
|
@ -244,7 +243,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testGetProductCodesForImage() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("getProductCodesForImageInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageId");
|
||||
|
||||
|
@ -264,7 +263,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testGetBlockDeviceMappingsForImage() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("getBlockDeviceMappingsForImageInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageId");
|
||||
|
||||
|
@ -284,7 +283,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testGetLaunchPermissionForImage() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("getLaunchPermissionForImageInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageId");
|
||||
|
||||
|
@ -304,7 +303,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testAddLaunchPermissionsToImage() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("addLaunchPermissionsToImageInRegion",
|
||||
Region.class, Iterable.class, Iterable.class, String.class);
|
||||
String.class, Iterable.class, Iterable.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
ImmutableList.of("bob", "sue"), ImmutableList.of("all"), "imageId");
|
||||
|
||||
|
@ -329,7 +328,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testRemoveLaunchPermissionsFromImage() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("removeLaunchPermissionsFromImageInRegion",
|
||||
Region.class, Iterable.class, Iterable.class, String.class);
|
||||
String.class, Iterable.class, Iterable.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
ImmutableList.of("bob", "sue"), ImmutableList.of("all"), "imageId");
|
||||
|
||||
|
@ -349,7 +348,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testResetLaunchPermissionsOnImage() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("resetLaunchPermissionsOnImageInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"imageId");
|
||||
|
||||
|
@ -368,7 +367,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testAddProductCodesToImage() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("addProductCodesToImageInRegion",
|
||||
Region.class, Iterable.class, String.class);
|
||||
String.class, Iterable.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
ImmutableList.of("code1", "code2"), "imageId");
|
||||
|
||||
|
@ -389,7 +388,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
|
|||
public void testRemoveProductCodesFromImage() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AMIAsyncClient.class.getMethod("removeProductCodesFromImageInRegion",
|
||||
Region.class, Iterable.class, String.class);
|
||||
String.class, Iterable.class, String.class);
|
||||
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
ImmutableList.of("code1", "code2"), "imageId");
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class AMIClientLiveTest {
|
|||
}
|
||||
|
||||
public void testDescribeImages() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
SortedSet<Image> allResults = Sets.newTreeSet(client.describeImagesInRegion(region));
|
||||
assertNotNull(allResults);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class AvailabilityZoneAndRegionAsyncClientTest extends
|
|||
public void testDescribeAvailabilityZones() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = AvailabilityZoneAndRegionAsyncClient.class.getMethod(
|
||||
"describeAvailabilityZonesInRegion", Region.class, Array.newInstance(
|
||||
"describeAvailabilityZonesInRegion", String.class, Array.newInstance(
|
||||
DescribeAvailabilityZonesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AvailabilityZoneAndRegionAsyncClient> httpMethod = processor
|
||||
.createRequest(method, Region.US_WEST_1);
|
||||
|
@ -71,7 +71,7 @@ public class AvailabilityZoneAndRegionAsyncClientTest extends
|
|||
public void testDescribeAvailabilityZonesOptions() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = AvailabilityZoneAndRegionAsyncClient.class.getMethod(
|
||||
"describeAvailabilityZonesInRegion", Region.class, Array.newInstance(
|
||||
"describeAvailabilityZonesInRegion", String.class, Array.newInstance(
|
||||
DescribeAvailabilityZonesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<AvailabilityZoneAndRegionAsyncClient> httpMethod = processor
|
||||
.createRequest(method, Region.US_EAST_1, availabilityZones(
|
||||
|
|
|
@ -68,7 +68,7 @@ public class AvailabilityZoneAndRegionClientLiveTest {
|
|||
}
|
||||
|
||||
public void testDescribeAvailabilityZones() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
SortedSet<AvailabilityZoneInfo> allResults = Sets.newTreeSet(client
|
||||
.describeAvailabilityZonesInRegion(region));
|
||||
|
@ -88,14 +88,14 @@ public class AvailabilityZoneAndRegionClientLiveTest {
|
|||
}
|
||||
|
||||
public void testDescribeRegions() {
|
||||
SortedMap<Region, URI> allResults = Maps.newTreeMap();
|
||||
SortedMap<String, URI> allResults = Maps.newTreeMap();
|
||||
allResults.putAll(client.describeRegions());
|
||||
assertNotNull(allResults);
|
||||
assert allResults.size() >= 2 : allResults.size();
|
||||
Iterator<Entry<Region, URI>> iterator = allResults.entrySet().iterator();
|
||||
Region r1 = iterator.next().getKey();
|
||||
Region r2 = iterator.next().getKey();
|
||||
SortedMap<Region, URI> twoResults = Maps.newTreeMap();
|
||||
Iterator<Entry<String, URI>> iterator = allResults.entrySet().iterator();
|
||||
String r1 = iterator.next().getKey();
|
||||
String r2 = iterator.next().getKey();
|
||||
SortedMap<String, URI> twoResults = Maps.newTreeMap();
|
||||
twoResults.putAll(client.describeRegions(regions(r1, r2)));
|
||||
assertNotNull(twoResults);
|
||||
assertEquals(twoResults.size(), 2);
|
||||
|
|
|
@ -79,7 +79,7 @@ public abstract class BaseEC2AsyncClientTest<T> extends RestClientTest<T> {
|
|||
.build(), "properties"));
|
||||
bind(URI.class).annotatedWith(EC2.class).toInstance(
|
||||
URI.create("https://ec2.amazonaws.com"));
|
||||
bind(Region.class).annotatedWith(EC2.class).toInstance(Region.US_EAST_1);
|
||||
bind(String.class).annotatedWith(EC2.class).toInstance(Region.US_EAST_1);
|
||||
bind(Logger.LoggerFactory.class).toInstance(new LoggerFactory() {
|
||||
public Logger getLogger(String category) {
|
||||
return Logger.NULL;
|
||||
|
@ -98,8 +98,8 @@ public abstract class BaseEC2AsyncClientTest<T> extends RestClientTest<T> {
|
|||
@Singleton
|
||||
@Provides
|
||||
@EC2
|
||||
Map<Region, URI> provideMap() {
|
||||
return ImmutableMap.<Region, URI> of(Region.EU_WEST_1, URI
|
||||
Map<String, URI> provideMap() {
|
||||
return ImmutableMap.<String, URI> of(Region.EU_WEST_1, URI
|
||||
.create("https://ec2.eu-west-1.amazonaws.com"), Region.US_EAST_1, URI
|
||||
.create("https://ec2.us-east-1.amazonaws.com"), Region.US_WEST_1, URI
|
||||
.create("https://ec2.us-west-1.amazonaws.com"));
|
||||
|
@ -108,8 +108,8 @@ public abstract class BaseEC2AsyncClientTest<T> extends RestClientTest<T> {
|
|||
@SuppressWarnings("unused")
|
||||
@Singleton
|
||||
@Provides
|
||||
Map<AvailabilityZone, Region> provideAvailabilityZoneRegionMap() {
|
||||
return ImmutableMap.<AvailabilityZone, Region> of(AvailabilityZone.US_EAST_1A,
|
||||
Map<AvailabilityZone, String> provideAvailabilityZoneRegionMap() {
|
||||
return ImmutableMap.<AvailabilityZone, String> of(AvailabilityZone.US_EAST_1A,
|
||||
Region.US_EAST_1);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
|
||||
public void testDeleteVolume() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("deleteVolumeInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "id");
|
||||
|
||||
|
@ -135,9 +135,9 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
|
||||
public void testDescribeVolumes() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("describeVolumesInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, (Region) null);
|
||||
method, (String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -154,7 +154,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testDescribeVolumesArgs() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("describeVolumesInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "1", "2");
|
||||
|
||||
|
@ -173,7 +173,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
|
||||
public void testAttachVolume() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("attachVolumeInRegion",
|
||||
Region.class, String.class, String.class, String.class);
|
||||
String.class, String.class, String.class, String.class);
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "id", "instanceId", "/device");
|
||||
|
||||
|
@ -192,7 +192,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
|
||||
public void testDetachVolume() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("detachVolumeInRegion",
|
||||
Region.class, String.class, boolean.class, Array.newInstance(
|
||||
String.class, String.class, boolean.class, Array.newInstance(
|
||||
DetachVolumeOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "id", false);
|
||||
|
@ -213,7 +213,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testDetachVolumeOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("detachVolumeInRegion",
|
||||
Region.class, String.class, boolean.class, Array.newInstance(
|
||||
String.class, String.class, boolean.class, Array.newInstance(
|
||||
DetachVolumeOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "id", true, fromInstance("instanceId").fromDevice("/device"));
|
||||
|
@ -234,7 +234,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
|
||||
public void testCreateSnapshot() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("createSnapshotInRegion",
|
||||
Region.class, String.class, Array.newInstance(CreateSnapshotOptions.class, 0)
|
||||
String.class, String.class, Array.newInstance(CreateSnapshotOptions.class, 0)
|
||||
.getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "volumeId");
|
||||
|
@ -254,7 +254,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testCreateSnapshotOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("createSnapshotInRegion",
|
||||
Region.class, String.class, Array.newInstance(CreateSnapshotOptions.class, 0)
|
||||
String.class, String.class, Array.newInstance(CreateSnapshotOptions.class, 0)
|
||||
.getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "volumeId", CreateSnapshotOptions.Builder
|
||||
|
@ -275,9 +275,9 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
|
||||
public void testDescribeSnapshots() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("describeSnapshotsInRegion",
|
||||
Region.class, Array.newInstance(DescribeSnapshotsOptions.class, 0).getClass());
|
||||
String.class, Array.newInstance(DescribeSnapshotsOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, (Region) null);
|
||||
method, (String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -294,7 +294,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testDescribeSnapshotsArgs() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod("describeSnapshotsInRegion",
|
||||
Region.class, Array.newInstance(DescribeSnapshotsOptions.class, 0).getClass());
|
||||
String.class, Array.newInstance(DescribeSnapshotsOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, ownedBy("o1", "o2").restorableBy("r1", "r2").snapshotIds("s1", "s2"));
|
||||
|
||||
|
@ -315,7 +315,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testGetCreateVolumePermissionForSnapshot() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod(
|
||||
"getCreateVolumePermissionForSnapshotInRegion", Region.class, String.class);
|
||||
"getCreateVolumePermissionForSnapshotInRegion", String.class, String.class);
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "snapshotId");
|
||||
|
||||
|
@ -336,7 +336,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testAddCreateVolumePermissionsToSnapshot() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod(
|
||||
"addCreateVolumePermissionsToSnapshotInRegion", Region.class, Iterable.class,
|
||||
"addCreateVolumePermissionsToSnapshotInRegion", String.class, Iterable.class,
|
||||
Iterable.class, String.class);
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, ImmutableList.of("bob", "sue"), ImmutableList.of("all"), "snapshotId");
|
||||
|
@ -358,7 +358,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testRemoveCreateVolumePermissionsFromSnapshot() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod(
|
||||
"removeCreateVolumePermissionsFromSnapshotInRegion", Region.class, Iterable.class,
|
||||
"removeCreateVolumePermissionsFromSnapshotInRegion", String.class, Iterable.class,
|
||||
Iterable.class, String.class);
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, ImmutableList.of("bob", "sue"), ImmutableList.of("all"), "snapshotId");
|
||||
|
@ -379,7 +379,7 @@ public class ElasticBlockStoreAsyncClientTest extends
|
|||
public void testResetCreateVolumePermissionsOnSnapshot() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = ElasticBlockStoreAsyncClient.class.getMethod(
|
||||
"resetCreateVolumePermissionsOnSnapshotInRegion", Region.class, String.class);
|
||||
"resetCreateVolumePermissionsOnSnapshotInRegion", String.class, String.class);
|
||||
GeneratedHttpRequest<ElasticBlockStoreAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, "snapshotId");
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ElasticBlockStoreClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testDescribeVolumes() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
SortedSet<Volume> allResults = Sets.newTreeSet(client.describeVolumesInRegion(region));
|
||||
assertNotNull(allResults);
|
||||
|
@ -171,7 +171,7 @@ public class ElasticBlockStoreClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testDescribeSnapshots() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
SortedSet<Snapshot> allResults = Sets.newTreeSet(client.describeSnapshotsInRegion(region));
|
||||
assertNotNull(allResults);
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.lang.reflect.Array;
|
|||
import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.xml.AllocateAddressResponseHandler;
|
||||
import org.jclouds.aws.ec2.xml.DescribeAddressesResponseHandler;
|
||||
import org.jclouds.http.functions.CloseContentAndReturn;
|
||||
|
@ -46,7 +45,7 @@ public class ElasticIPAddressAsyncClientTest extends
|
|||
public void testDisassociateAddress() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = ElasticIPAddressAsyncClient.class.getMethod("disassociateAddressInRegion",
|
||||
Region.class, InetAddress.class);
|
||||
String.class, InetAddress.class);
|
||||
GeneratedHttpRequest<ElasticIPAddressAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }));
|
||||
|
||||
|
@ -65,7 +64,7 @@ public class ElasticIPAddressAsyncClientTest extends
|
|||
|
||||
public void testAssociateAddress() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticIPAddressAsyncClient.class.getMethod("associateAddressInRegion",
|
||||
Region.class, InetAddress.class, String.class);
|
||||
String.class, InetAddress.class, String.class);
|
||||
GeneratedHttpRequest<ElasticIPAddressAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }), "me");
|
||||
|
||||
|
@ -84,7 +83,7 @@ public class ElasticIPAddressAsyncClientTest extends
|
|||
|
||||
public void testReleaseAddress() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticIPAddressAsyncClient.class.getMethod("releaseAddressInRegion",
|
||||
Region.class, InetAddress.class);
|
||||
String.class, InetAddress.class);
|
||||
GeneratedHttpRequest<ElasticIPAddressAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }));
|
||||
|
||||
|
@ -102,7 +101,7 @@ public class ElasticIPAddressAsyncClientTest extends
|
|||
|
||||
public void testDescribeAddresses() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticIPAddressAsyncClient.class.getMethod("describeAddressesInRegion",
|
||||
Region.class, Array.newInstance(InetAddress.class, 0).getClass());
|
||||
String.class, Array.newInstance(InetAddress.class, 0).getClass());
|
||||
GeneratedHttpRequest<ElasticIPAddressAsyncClient> httpMethod = processor.createRequest(
|
||||
method, null, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }));
|
||||
|
||||
|
@ -121,9 +120,9 @@ public class ElasticIPAddressAsyncClientTest extends
|
|||
|
||||
public void testAllocateAddress() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = ElasticIPAddressAsyncClient.class.getMethod("allocateAddressInRegion",
|
||||
Region.class);
|
||||
String.class);
|
||||
GeneratedHttpRequest<ElasticIPAddressAsyncClient> httpMethod = processor.createRequest(
|
||||
method, (Region) null);
|
||||
method, (String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ElasticIPAddressClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testDescribeAddresses() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
SortedSet<PublicIpInstanceIdPair> allResults = Sets.newTreeSet(client
|
||||
.describeAddressesInRegion(region));
|
||||
|
|
|
@ -55,9 +55,9 @@ import com.google.inject.TypeLiteral;
|
|||
public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyncClient> {
|
||||
public void testDescribeInstances() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("describeInstancesInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method,
|
||||
(Region) null);
|
||||
(String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -74,7 +74,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testDescribeInstancesArgs() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("describeInstancesInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "2");
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testTerminateInstances() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("terminateInstancesInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "2");
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
}
|
||||
|
||||
public void testRunInstances() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("runInstancesInRegion", Region.class,
|
||||
Method method = InstanceAsyncClient.class.getMethod("runInstancesInRegion", String.class,
|
||||
AvailabilityZone.class, String.class, int.class, int.class, Array.newInstance(
|
||||
RunInstancesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
|
@ -133,7 +133,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
|
||||
public void testRunInstancesOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("runInstancesInRegion", Region.class,
|
||||
Method method = InstanceAsyncClient.class.getMethod("runInstancesInRegion", String.class,
|
||||
AvailabilityZone.class, String.class, int.class, int.class, Array.newInstance(
|
||||
RunInstancesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method,
|
||||
|
@ -157,7 +157,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
}
|
||||
|
||||
public void testStopInstances() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("stopInstancesInRegion", Region.class,
|
||||
Method method = InstanceAsyncClient.class.getMethod("stopInstancesInRegion", String.class,
|
||||
boolean.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
true, "1", "2");
|
||||
|
@ -176,7 +176,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
}
|
||||
|
||||
public void testRebootInstances() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("rebootInstancesInRegion", Region.class,
|
||||
Method method = InstanceAsyncClient.class.getMethod("rebootInstancesInRegion", String.class,
|
||||
Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "2");
|
||||
|
@ -195,7 +195,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
}
|
||||
|
||||
public void testStartInstances() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("startInstancesInRegion", Region.class,
|
||||
Method method = InstanceAsyncClient.class.getMethod("startInstancesInRegion", String.class,
|
||||
Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "2");
|
||||
|
@ -216,7 +216,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetUserDataForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("getUserDataForInstanceInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -236,7 +236,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetRootDeviceNameForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("getRootDeviceNameForInstanceInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -256,7 +256,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetRamdiskForInstanceInRegion() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("getRamdiskForInstanceInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -276,7 +276,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetDisableApiTerminationForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod(
|
||||
"isApiTerminationDisabledForInstanceInRegion", Region.class, String.class);
|
||||
"isApiTerminationDisabledForInstanceInRegion", String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -296,7 +296,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetKernelForInstanceInRegion() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("getKernelForInstanceInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -316,7 +316,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetInstanceTypeForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("getInstanceTypeForInstanceInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -336,7 +336,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetInstanceInitiatedShutdownBehaviorForInstanceInRegion()
|
||||
throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod(
|
||||
"getInstanceInitiatedShutdownBehaviorForInstanceInRegion", Region.class,
|
||||
"getInstanceInitiatedShutdownBehaviorForInstanceInRegion", String.class,
|
||||
String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
@ -358,7 +358,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testGetBlockDeviceMappingForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod(
|
||||
"getBlockDeviceMappingForInstanceInRegion", Region.class, String.class);
|
||||
"getBlockDeviceMappingForInstanceInRegion", String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1");
|
||||
|
||||
|
@ -378,7 +378,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetUserDataForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("setUserDataForInstanceInRegion",
|
||||
Region.class, String.class, Array.newInstance(byte.class, 0).getClass());
|
||||
String.class, String.class, Array.newInstance(byte.class, 0).getClass());
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "test".getBytes());
|
||||
|
||||
|
@ -403,7 +403,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetRamdiskForInstanceInRegion() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("setRamdiskForInstanceInRegion",
|
||||
Region.class, String.class, String.class);
|
||||
String.class, String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "test");
|
||||
|
||||
|
@ -422,7 +422,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetKernelForInstanceInRegion() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("setKernelForInstanceInRegion",
|
||||
Region.class, String.class, String.class);
|
||||
String.class, String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "test");
|
||||
|
||||
|
@ -441,7 +441,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetApiTerminationDisabledForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod(
|
||||
"setApiTerminationDisabledForInstanceInRegion", Region.class, String.class,
|
||||
"setApiTerminationDisabledForInstanceInRegion", String.class, String.class,
|
||||
boolean.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", true);
|
||||
|
@ -463,7 +463,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetInstanceTypeForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod("setInstanceTypeForInstanceInRegion",
|
||||
Region.class, String.class, String.class);
|
||||
String.class, String.class, String.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", InstanceType.C1_MEDIUM);
|
||||
|
||||
|
@ -484,7 +484,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetInstanceInitiatedShutdownBehaviorForInstanceInRegion()
|
||||
throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod(
|
||||
"setInstanceInitiatedShutdownBehaviorForInstanceInRegion", Region.class,
|
||||
"setInstanceInitiatedShutdownBehaviorForInstanceInRegion", String.class,
|
||||
String.class, InstanceInitiatedShutdownBehavior.class);
|
||||
GeneratedHttpRequest<InstanceAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", InstanceInitiatedShutdownBehavior.TERMINATE);
|
||||
|
@ -506,7 +506,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
|
|||
public void testSetBlockDeviceMappingForInstanceInRegion() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = InstanceAsyncClient.class.getMethod(
|
||||
"setBlockDeviceMappingForInstanceInRegion", Region.class, String.class,
|
||||
"setBlockDeviceMappingForInstanceInRegion", String.class, String.class,
|
||||
BlockDeviceMapping.class);
|
||||
|
||||
BlockDeviceMapping blockDeviceMapping = new BlockDeviceMapping();
|
||||
|
|
|
@ -61,7 +61,7 @@ public class InstanceClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testDescribeInstances() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
Set<Reservation> allResults = client.describeInstancesInRegion(region);
|
||||
assertNotNull(allResults);
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.io.IOException;
|
|||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.xml.DescribeKeyPairsResponseHandler;
|
||||
import org.jclouds.http.functions.CloseContentAndReturn;
|
||||
import org.jclouds.http.functions.ParseSax;
|
||||
|
@ -41,7 +40,7 @@ import com.google.inject.TypeLiteral;
|
|||
public class KeyPairAsyncClientTest extends BaseEC2AsyncClientTest<KeyPairAsyncClient> {
|
||||
|
||||
public void testDeleteKeyPair() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = KeyPairAsyncClient.class.getMethod("deleteKeyPairInRegion", Region.class,
|
||||
Method method = KeyPairAsyncClient.class.getMethod("deleteKeyPairInRegion", String.class,
|
||||
String.class);
|
||||
GeneratedHttpRequest<KeyPairAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"mykey");
|
||||
|
@ -59,10 +58,10 @@ public class KeyPairAsyncClientTest extends BaseEC2AsyncClientTest<KeyPairAsyncC
|
|||
}
|
||||
|
||||
public void testDescribeKeyPairs() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = KeyPairAsyncClient.class.getMethod("describeKeyPairsInRegion", Region.class,
|
||||
Method method = KeyPairAsyncClient.class.getMethod("describeKeyPairsInRegion", String.class,
|
||||
Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<KeyPairAsyncClient> httpMethod = processor.createRequest(method,
|
||||
(Region) null);
|
||||
(String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -78,7 +77,7 @@ public class KeyPairAsyncClientTest extends BaseEC2AsyncClientTest<KeyPairAsyncC
|
|||
|
||||
public void testDescribeKeyPairsArgs() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = KeyPairAsyncClient.class.getMethod("describeKeyPairsInRegion", Region.class,
|
||||
Method method = KeyPairAsyncClient.class.getMethod("describeKeyPairsInRegion", String.class,
|
||||
Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<KeyPairAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"1", "2");
|
||||
|
|
|
@ -61,7 +61,7 @@ public class KeyPairClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testDescribeKeyPairs() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
|
||||
SortedSet<KeyPair> allResults = Sets.newTreeSet(client.describeKeyPairsInRegion(region));
|
||||
|
|
|
@ -42,7 +42,7 @@ public class MonitoringAsyncClientTest extends BaseEC2AsyncClientTest<Monitoring
|
|||
public void testUnmonitorInstances() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = MonitoringAsyncClient.class.getMethod("unmonitorInstancesInRegion",
|
||||
Region.class, String.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<MonitoringAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "instance1", "instance2");
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class MonitoringAsyncClientTest extends BaseEC2AsyncClientTest<Monitoring
|
|||
|
||||
public void testMonitorInstances() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = MonitoringAsyncClient.class.getMethod("monitorInstancesInRegion",
|
||||
Region.class, String.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<MonitoringAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "instance1", "instance2");
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.io.IOException;
|
|||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.jclouds.aws.domain.Region;
|
||||
import org.jclouds.aws.ec2.domain.IpProtocol;
|
||||
import org.jclouds.aws.ec2.domain.UserIdGroupPair;
|
||||
import org.jclouds.aws.ec2.functions.ReturnVoidOnGroupNotFound;
|
||||
|
@ -46,7 +45,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testDeleteSecurityGroup() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod("deleteSecurityGroupInRegion",
|
||||
Region.class, String.class);
|
||||
String.class, String.class);
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "name");
|
||||
|
||||
|
@ -66,7 +65,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testCreateSecurityGroup() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod("createSecurityGroupInRegion",
|
||||
Region.class, String.class, String.class);
|
||||
String.class, String.class, String.class);
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "name", "description");
|
||||
|
||||
|
@ -86,9 +85,9 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testDescribeSecurityGroups() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod("describeSecurityGroupsInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
(Region) null);
|
||||
(String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://ec2.amazonaws.com/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -105,7 +104,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testDescribeSecurityGroupsArgs() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod("describeSecurityGroupsInRegion",
|
||||
Region.class, Array.newInstance(String.class, 0).getClass());
|
||||
String.class, Array.newInstance(String.class, 0).getClass());
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "1", "2");
|
||||
|
||||
|
@ -125,7 +124,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testAuthorizeSecurityGroupIngressGroup() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod(
|
||||
"authorizeSecurityGroupIngressInRegion", Region.class, String.class,
|
||||
"authorizeSecurityGroupIngressInRegion", String.class, String.class,
|
||||
UserIdGroupPair.class);
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "group", new UserIdGroupPair("sourceUser", "sourceGroup"));
|
||||
|
@ -147,7 +146,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testAuthorizeSecurityGroupIngressCidr() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod(
|
||||
"authorizeSecurityGroupIngressInRegion", Region.class, String.class,
|
||||
"authorizeSecurityGroupIngressInRegion", String.class, String.class,
|
||||
IpProtocol.class, int.class, int.class, String.class);
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "group", IpProtocol.TCP, 6000, 7000, "0.0.0.0/0");
|
||||
|
@ -169,7 +168,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testRevokeSecurityGroupIngressGroup() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod(
|
||||
"revokeSecurityGroupIngressInRegion", Region.class, String.class,
|
||||
"revokeSecurityGroupIngressInRegion", String.class, String.class,
|
||||
UserIdGroupPair.class);
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "group", new UserIdGroupPair("sourceUser", "sourceGroup"));
|
||||
|
@ -191,7 +190,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
|
|||
public void testRevokeSecurityGroupIngressCidr() throws SecurityException,
|
||||
NoSuchMethodException, IOException {
|
||||
Method method = SecurityGroupAsyncClient.class.getMethod(
|
||||
"revokeSecurityGroupIngressInRegion", Region.class, String.class, IpProtocol.class,
|
||||
"revokeSecurityGroupIngressInRegion", String.class, String.class, IpProtocol.class,
|
||||
int.class, int.class, String.class);
|
||||
GeneratedHttpRequest<SecurityGroupAsyncClient> httpMethod = processor.createRequest(method,
|
||||
null, "group", IpProtocol.TCP, 6000, 7000, "0.0.0.0/0");
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SecurityGroupClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testDescribe() {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1, Region.US_WEST_1)) {
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1, Region.US_WEST_1)) {
|
||||
SortedSet<SecurityGroup> allResults = Sets.newTreeSet(client
|
||||
.describeSecurityGroupsInRegion(region));
|
||||
assertNotNull(allResults);
|
||||
|
|
|
@ -40,7 +40,7 @@ import com.google.inject.Provides;
|
|||
* @author Adrian Cole
|
||||
*/
|
||||
public class BaseEC2HandlerTest extends BaseHandlerTest {
|
||||
protected Region defaultRegion = Region.US_EAST_1;
|
||||
protected String defaultRegion = Region.US_EAST_1;
|
||||
|
||||
public BaseEC2HandlerTest() {
|
||||
super();
|
||||
|
@ -60,15 +60,15 @@ public class BaseEC2HandlerTest extends BaseHandlerTest {
|
|||
@Singleton
|
||||
@Provides
|
||||
@EC2
|
||||
Region provideDefaultRegion() {
|
||||
String provideDefaultRegion() {
|
||||
return defaultRegion;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Singleton
|
||||
@Provides
|
||||
Map<AvailabilityZone, Region> provideAvailabilityZoneRegionMap() {
|
||||
return ImmutableMap.<AvailabilityZone, Region> of(AvailabilityZone.US_EAST_1A,
|
||||
Map<AvailabilityZone, String> provideAvailabilityZoneRegionMap() {
|
||||
return ImmutableMap.<AvailabilityZone, String> of(AvailabilityZone.US_EAST_1A,
|
||||
Region.US_EAST_1);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -62,12 +62,12 @@ public class DescribeRegionsResponseHandlerTest extends BaseHandlerTest {
|
|||
|
||||
InputStream is = getClass().getResourceAsStream("/ec2/regionEndpoints.xml");
|
||||
|
||||
Map<Region, URI> expected = ImmutableMap.<Region, URI> of(Region.EU_WEST_1, URI
|
||||
Map<String, URI> expected = ImmutableMap.<String, URI> of(Region.EU_WEST_1, URI
|
||||
.create("https://ec2.eu-west-1.amazonaws.com"), Region.US_EAST_1, URI
|
||||
.create("https://ec2.us-east-1.amazonaws.com"), Region.US_WEST_1, URI
|
||||
.create("https://ec2.us-west-1.amazonaws.com"));
|
||||
|
||||
Map<Region, URI> result = factory.create(
|
||||
Map<String, URI> result = factory.create(
|
||||
injector.getInstance(DescribeRegionsResponseHandler.class)).parse(is);
|
||||
|
||||
assertEquals(result, expected);
|
||||
|
@ -77,13 +77,13 @@ public class DescribeRegionsResponseHandlerTest extends BaseHandlerTest {
|
|||
|
||||
InputStream is = getClass().getResourceAsStream("/ec2/regionEndpoints-additional.xml");
|
||||
|
||||
Map<Region, URI> expected = ImmutableMap.<Region, URI> of(Region.UNKNOWN, URI
|
||||
Map<String, URI> expected = ImmutableMap.<String, URI> of("jp-west-1", URI
|
||||
.create("https://ec2.jp-west-1.amazonaws.com"), Region.EU_WEST_1, URI
|
||||
.create("https://ec2.eu-west-1.amazonaws.com"), Region.US_EAST_1, URI
|
||||
.create("https://ec2.us-east-1.amazonaws.com"), Region.US_WEST_1, URI
|
||||
.create("https://ec2.us-west-1.amazonaws.com"));
|
||||
|
||||
Map<Region, URI> result = factory.create(
|
||||
Map<String, URI> result = factory.create(
|
||||
injector.getInstance(DescribeRegionsResponseHandler.class)).parse(is);
|
||||
|
||||
assertEquals(result, expected);
|
||||
|
|
|
@ -380,10 +380,10 @@ public class S3AsyncClientTest extends RestClientTest<S3AsyncClient> {
|
|||
|
||||
public void testPutBucketDefault() throws ArrayIndexOutOfBoundsException, SecurityException,
|
||||
IllegalArgumentException, NoSuchMethodException, IOException {
|
||||
Method method = S3AsyncClient.class.getMethod("putBucketInRegion", Region.class,
|
||||
Method method = S3AsyncClient.class.getMethod("putBucketInRegion", String.class,
|
||||
String.class, Array.newInstance(PutBucketOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<S3AsyncClient> httpMethod = processor.createRequest(method,
|
||||
(Region) null, "bucket");
|
||||
(String) null, "bucket");
|
||||
|
||||
assertRequestLineEquals(httpMethod, "PUT http://bucket.stub:8080/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod, "Content-Length: 0\nHost: bucket.stub\n");
|
||||
|
@ -398,7 +398,7 @@ public class S3AsyncClientTest extends RestClientTest<S3AsyncClient> {
|
|||
|
||||
public void testPutBucketEu() throws ArrayIndexOutOfBoundsException, SecurityException,
|
||||
IllegalArgumentException, NoSuchMethodException, IOException {
|
||||
Method method = S3AsyncClient.class.getMethod("putBucketInRegion", Region.class,
|
||||
Method method = S3AsyncClient.class.getMethod("putBucketInRegion", String.class,
|
||||
String.class, Array.newInstance(PutBucketOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<S3AsyncClient> httpMethod = processor.createRequest(method,
|
||||
Region.EU_WEST_1, "bucket");
|
||||
|
@ -547,7 +547,7 @@ public class S3AsyncClientTest extends RestClientTest<S3AsyncClient> {
|
|||
Jsr330.bindProperties(binder(), checkNotNull(new S3PropertiesBuilder("user", "key")
|
||||
.build(), "properties"));
|
||||
bind(URI.class).annotatedWith(S3.class).toInstance(URI.create("http://stub:8080"));
|
||||
bind(Region.class).annotatedWith(S3.class).toInstance(Region.US_STANDARD);
|
||||
bind(String.class).annotatedWith(S3.class).toInstance(Region.US_STANDARD);
|
||||
bind(Logger.LoggerFactory.class).toInstance(new LoggerFactory() {
|
||||
public Logger getLogger(String category) {
|
||||
return Logger.NULL;
|
||||
|
|
|
@ -51,8 +51,8 @@ public class S3StubClientModule extends AbstractModule {
|
|||
install(new TransientBlobStoreModule());
|
||||
bind(S3AsyncClient.class).to(StubS3AsyncClient.class).asEagerSingleton();
|
||||
bind(URI.class).annotatedWith(S3.class).toInstance(URI.create("https://localhost/s3stub"));
|
||||
bind(Region.class).annotatedWith(S3.class).toInstance(Region.US_STANDARD);
|
||||
bind(new TypeLiteral<Set<Region>>() {
|
||||
bind(String.class).annotatedWith(S3.class).toInstance(Region.US_STANDARD);
|
||||
bind(new TypeLiteral<Set<String>>() {
|
||||
}).annotatedWith(S3.class).toInstance(
|
||||
ImmutableSet.of(Region.US_STANDARD, Region.US_WEST_1, Region.EU_WEST_1));
|
||||
}
|
||||
|
|
|
@ -136,14 +136,14 @@ public class StubS3AsyncClient implements S3AsyncClient {
|
|||
public static final String DEFAULT_OWNER_ID = "abc123";
|
||||
|
||||
@Override
|
||||
public ListenableFuture<Boolean> putBucketInRegion(@Nullable Region region, String name,
|
||||
public ListenableFuture<Boolean> putBucketInRegion(@Nullable String region, String name,
|
||||
PutBucketOptions... optionsList) {
|
||||
region = region == null ? Region.US_STANDARD : region;
|
||||
final PutBucketOptions options = (optionsList.length == 0) ? new PutBucketOptions()
|
||||
: optionsList[0];
|
||||
keyToAcl.put(name, options.getAcl());
|
||||
return blobStore.createContainerInLocation(new LocationImpl(LocationScope.REGION, region
|
||||
.value(), region.value(), null), name);
|
||||
return blobStore.createContainerInLocation(new LocationImpl(LocationScope.REGION, region,
|
||||
region, null), name);
|
||||
}
|
||||
|
||||
public ListenableFuture<ListBucketResponse> listBucket(final String name,
|
||||
|
@ -315,9 +315,9 @@ public class StubS3AsyncClient implements S3AsyncClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ListenableFuture<Region> getBucketLocation(String bucketName) {
|
||||
public ListenableFuture<String> getBucketLocation(String bucketName) {
|
||||
Location location = containerToLocation.get(bucketName);
|
||||
return immediateFuture(Region.fromValue(location.getId()));
|
||||
return immediateFuture(location.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -179,7 +179,7 @@ public class BucketsLiveTest extends BaseBlobStoreIntegrationTest {
|
|||
|
||||
String bucketName = getContainerName();
|
||||
try {
|
||||
Region location = getApi().getBucketLocation(bucketName);
|
||||
String location = getApi().getBucketLocation(bucketName);
|
||||
assert location.equals(Region.US_STANDARD) : "bucket: " + bucketName + " location: "
|
||||
+ location;
|
||||
} finally {
|
||||
|
|
|
@ -61,10 +61,10 @@ import com.google.inject.TypeLiteral;
|
|||
public class SQSAsyncClientTest extends RestClientTest<SQSAsyncClient> {
|
||||
public void testListQueuesInRegion() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SQSAsyncClient.class.getMethod("listQueuesInRegion", Region.class, Array
|
||||
Method method = SQSAsyncClient.class.getMethod("listQueuesInRegion", String.class, Array
|
||||
.newInstance(ListQueuesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<SQSAsyncClient> httpMethod = processor.createRequest(method,
|
||||
(Region) null);
|
||||
(String) null);
|
||||
|
||||
assertRequestLineEquals(httpMethod, "POST https://default/ HTTP/1.1");
|
||||
assertHeadersEqual(httpMethod,
|
||||
|
@ -80,7 +80,7 @@ public class SQSAsyncClientTest extends RestClientTest<SQSAsyncClient> {
|
|||
|
||||
public void testListQueuesInRegionOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SQSAsyncClient.class.getMethod("listQueuesInRegion", Region.class, Array
|
||||
Method method = SQSAsyncClient.class.getMethod("listQueuesInRegion", String.class, Array
|
||||
.newInstance(ListQueuesOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<SQSAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
ListQueuesOptions.Builder.queuePrefix("prefix"));
|
||||
|
@ -99,7 +99,7 @@ public class SQSAsyncClientTest extends RestClientTest<SQSAsyncClient> {
|
|||
|
||||
public void testCreateQueueInRegion() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SQSAsyncClient.class.getMethod("createQueueInRegion", Region.class,
|
||||
Method method = SQSAsyncClient.class.getMethod("createQueueInRegion", String.class,
|
||||
String.class, Array.newInstance(CreateQueueOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<SQSAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"queueName");
|
||||
|
@ -118,7 +118,7 @@ public class SQSAsyncClientTest extends RestClientTest<SQSAsyncClient> {
|
|||
|
||||
public void testCreateQueueInRegionOptions() throws SecurityException, NoSuchMethodException,
|
||||
IOException {
|
||||
Method method = SQSAsyncClient.class.getMethod("createQueueInRegion", Region.class,
|
||||
Method method = SQSAsyncClient.class.getMethod("createQueueInRegion", String.class,
|
||||
String.class, Array.newInstance(CreateQueueOptions.class, 0).getClass());
|
||||
GeneratedHttpRequest<SQSAsyncClient> httpMethod = processor.createRequest(method, null,
|
||||
"queueName", CreateQueueOptions.Builder.defaultVisibilityTimeout(45));
|
||||
|
@ -178,8 +178,8 @@ public class SQSAsyncClientTest extends RestClientTest<SQSAsyncClient> {
|
|||
@Singleton
|
||||
@Provides
|
||||
@SQS
|
||||
Map<Region, URI> provideMap() {
|
||||
return ImmutableMap.<Region, URI> of(Region.EU_WEST_1, URI
|
||||
Map<String, URI> provideMap() {
|
||||
return ImmutableMap.<String, URI> of(Region.EU_WEST_1, URI
|
||||
.create("https://sqs.eu-west-1.amazonaws.com"), Region.US_EAST_1, URI
|
||||
.create("https://sqs.us-east-1.amazonaws.com"), Region.US_WEST_1, URI
|
||||
.create("https://sqs.us-west-1.amazonaws.com"));
|
||||
|
|
|
@ -66,7 +66,7 @@ public class SQSClientLiveTest {
|
|||
|
||||
@Test
|
||||
void testListQueuesInRegion() throws InterruptedException {
|
||||
for (Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1, Region.US_WEST_1)) {
|
||||
for (String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1, Region.US_WEST_1)) {
|
||||
SortedSet<Queue> allResults = Sets.newTreeSet(client.listQueuesInRegion(region));
|
||||
assertNotNull(allResults);
|
||||
if (allResults.size() >= 1) {
|
||||
|
@ -82,7 +82,7 @@ public class SQSClientLiveTest {
|
|||
void testCreateQueue() throws InterruptedException {
|
||||
String queueName = PREFIX + "1";
|
||||
|
||||
for (final Region region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
for (final String region : ImmutableSet.of(Region.EU_WEST_1, Region.US_EAST_1,
|
||||
Region.US_WEST_1)) {
|
||||
try {
|
||||
SortedSet<Queue> result = Sets.newTreeSet(client.listQueuesInRegion(region,
|
||||
|
@ -125,7 +125,7 @@ public class SQSClientLiveTest {
|
|||
}
|
||||
}
|
||||
|
||||
private void assertQueueInList(final Region region, Queue queue) throws InterruptedException {
|
||||
private void assertQueueInList(final String region, Queue queue) throws InterruptedException {
|
||||
final Queue finalQ = queue;
|
||||
assertEventually(new Runnable() {
|
||||
public void run() {
|
||||
|
|
|
@ -75,9 +75,9 @@ public class SQSRestClientModuleTest {
|
|||
|
||||
@Test
|
||||
void testRegions() {
|
||||
Map<Region, URI> regionMap = createInjector().getInstance(new Key<Map<Region, URI>>(SQS.class) {
|
||||
Map<String, URI> regionMap = createInjector().getInstance(new Key<Map<String, URI>>(SQS.class) {
|
||||
});
|
||||
assertEquals(regionMap, ImmutableMap.<Region, URI> of(Region.US_EAST_1, URI
|
||||
assertEquals(regionMap, ImmutableMap.<String, URI> of(Region.US_EAST_1, URI
|
||||
.create("https://queue.amazonaws.com"), Region.US_WEST_1, URI
|
||||
.create("https://us-west-1.queue.amazonaws.com"), Region.EU_WEST_1, URI
|
||||
.create("https://eu-west-1.queue.amazonaws.com")));
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue