From e9cff5e17caac2ed84d733cbc1e30700d42cea1a Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 9 Nov 2011 11:19:40 +0100 Subject: [PATCH] Issue 747:add new us-west-2 region --- .../compute/TestCanRecreateGroupLiveTest.java | 2 +- .../java/org/jclouds/aws/domain/Region.java | 19 +++++++++++++------ .../AWSCloudWatchPropertiesBuilder.java | 2 ++ .../AWSCloudWatchProviderMetadata.java | 2 +- .../aws/ec2/AWSEC2ProviderMetadata.java | 2 +- .../compute/AWSEC2ComputeServiceLiveTest.java | 2 +- .../AWSEC2TemplateBuilderLiveTest.java | 6 +++--- .../services/SpotInstanceClientLiveTest.java | 2 +- .../aws/s3/AWSS3PropertiesBuilder.java | 2 ++ .../jclouds/aws/s3/AWSS3ProviderMetadata.java | 2 +- 10 files changed, 26 insertions(+), 15 deletions(-) diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/TestCanRecreateGroupLiveTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/TestCanRecreateGroupLiveTest.java index 2b6802f924..b82ef10ae0 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/TestCanRecreateGroupLiveTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/TestCanRecreateGroupLiveTest.java @@ -90,7 +90,7 @@ public class TestCanRecreateGroupLiveTest { context.getComputeService().destroyNodesMatching(NodePredicates.inGroup(tag)); try { - Template template = context.getComputeService().templateBuilder().locationId("us-west-1").build(); + Template template = context.getComputeService().templateBuilder().locationId("us-west-2").build(); context.getComputeService().createNodesInGroup(tag, 1, template); context.getComputeService().destroyNodesMatching(NodePredicates.inGroup(tag)); context.getComputeService().createNodesInGroup(tag, 1, template); diff --git a/common/aws/src/main/java/org/jclouds/aws/domain/Region.java b/common/aws/src/main/java/org/jclouds/aws/domain/Region.java index f526f30f7e..64821a304e 100644 --- a/common/aws/src/main/java/org/jclouds/aws/domain/Region.java +++ b/common/aws/src/main/java/org/jclouds/aws/domain/Region.java @@ -83,7 +83,12 @@ public class Region { * and DELETES. */ public static final String US_WEST_1 = "us-west-1"; - + + /** + * US-West-2 (Oregon) + */ + public static final String US_WEST_2 = "us-west-2"; + /** * Region in Singapore, launched April 28, 2010. This region improves latency for Asia-based * users @@ -95,17 +100,18 @@ public class Region { */ public static final String AP_NORTHEAST_1 = "ap-northeast-1"; - public static Set DEFAULT_S3 = ImmutableSet.of(EU, US_STANDARD, US_WEST_1, AP_SOUTHEAST_1, AP_NORTHEAST_1); - - public static Set DEFAULT_REGIONS = ImmutableSet.of(US_EAST_1, US_WEST_1, EU_WEST_1, AP_SOUTHEAST_1, + public static Set DEFAULT_S3 = ImmutableSet.of(EU, US_STANDARD, US_WEST_1, US_WEST_2, AP_SOUTHEAST_1, AP_NORTHEAST_1); + public static Set DEFAULT_REGIONS = ImmutableSet.of(US_EAST_1, US_WEST_1, US_WEST_2, EU_WEST_1, + AP_SOUTHEAST_1, AP_NORTHEAST_1); + public static Properties regionPropertiesS3() { Properties properties = regionProperties(); properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(DEFAULT_S3)); // note that due to US_STANDARD the codes include US instead of US-VA - properties.setProperty(PROPERTY_ISO3166_CODES, "US,US-CA,IE,SG,JP-13"); + properties.setProperty(PROPERTY_ISO3166_CODES, "US,US-CA,US-OR,IE,SG,JP-13"); properties.setProperty(PROPERTY_REGION + "." + US_STANDARD + "." + ISO3166_CODES, "US"); properties.setProperty(PROPERTY_REGION + "." + EU + "." + ISO3166_CODES, "IE"); return properties; @@ -114,9 +120,10 @@ public class Region { public static Properties regionProperties() { Properties properties = new Properties(); properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(DEFAULT_REGIONS)); - properties.setProperty(PROPERTY_ISO3166_CODES, "US-VA,US-CA,IE,SG,JP-13"); + properties.setProperty(PROPERTY_ISO3166_CODES, "US-VA,US-CA,US-OR,IE,SG,JP-13"); properties.setProperty(PROPERTY_REGION + "." + US_EAST_1 + "." + ISO3166_CODES, "US-VA"); properties.setProperty(PROPERTY_REGION + "." + US_WEST_1 + "." + ISO3166_CODES, "US-CA"); + properties.setProperty(PROPERTY_REGION + "." + US_WEST_2 + "." + ISO3166_CODES, "US-OR"); properties.setProperty(PROPERTY_REGION + "." + EU_WEST_1 + "." + ISO3166_CODES, "IE"); properties.setProperty(PROPERTY_REGION + "." + AP_SOUTHEAST_1 + "." + ISO3166_CODES, "SG"); properties.setProperty(PROPERTY_REGION + "." + AP_NORTHEAST_1 + "." + ISO3166_CODES, "JP-13"); diff --git a/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchPropertiesBuilder.java b/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchPropertiesBuilder.java index ee801adf12..1c8653987c 100644 --- a/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchPropertiesBuilder.java +++ b/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchPropertiesBuilder.java @@ -49,6 +49,8 @@ public class AWSCloudWatchPropertiesBuilder extends CloudWatchPropertiesBuilder "https://monitoring.us-east-1.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + Region.US_WEST_1 + ".endpoint", "https://monitoring.us-west-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + Region.US_WEST_2 + ".endpoint", + "https://monitoring.us-west-2.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + Region.EU_WEST_1 + ".endpoint", "https://monitoring.eu-west-1.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + Region.AP_SOUTHEAST_1 + ".endpoint", diff --git a/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchProviderMetadata.java b/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchProviderMetadata.java index dac2845e30..ed273b97af 100644 --- a/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchProviderMetadata.java +++ b/providers/aws-cloudwatch/src/main/java/org/jclouds/aws/cloudwatch/AWSCloudWatchProviderMetadata.java @@ -110,6 +110,6 @@ public class AWSCloudWatchProviderMetadata extends BaseProviderMetadata { */ @Override public Set getIso3166Codes() { - return ImmutableSet.of("US-VA", "US-CA", "IE", "SG", "JP-13"); + return ImmutableSet.of("US-VA", "US-CA", "US-OR", "IE", "SG", "JP-13"); } } diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ProviderMetadata.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ProviderMetadata.java index b9f3645955..3da0f1dd10 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ProviderMetadata.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ProviderMetadata.java @@ -110,7 +110,7 @@ public class AWSEC2ProviderMetadata extends BaseProviderMetadata { */ @Override public Set getIso3166Codes() { - return ImmutableSet.of("US-VA", "US-CA", "IE", "SG", "JP-13"); + return ImmutableSet.of("US-VA", "US-CA", "US-OR", "IE", "SG", "JP-13"); } } \ No newline at end of file diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java index 7026ab2c83..6b4044e4c1 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java @@ -79,7 +79,7 @@ public class AWSEC2ComputeServiceLiveTest extends EC2ComputeServiceLiveTest { @Test(dependsOnMethods = "testCompareSizes") public void testExtendedOptionsAndLogin() throws Exception { // note that this is sensitive to regions that quickly fill spot requests - String region = "us-west-1"; + String region = "us-west-2"; AWSSecurityGroupClient securityGroupClient = AWSEC2Client.class.cast(context.getProviderSpecificContext().getApi()) .getSecurityGroupServices(); diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java index 9d40d007ac..5d07030e51 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java @@ -141,7 +141,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { Template defaultTemplate = context.getComputeService().templateBuilder().build(); assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; - assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.1"); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.2"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs"); @@ -157,7 +157,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { Template defaultTemplate = context.getComputeService().templateBuilder().osFamily(OsFamily.AMZN_LINUX) .imageMatches(EC2ImagePredicates.rootDeviceType(RootDeviceType.INSTANCE_STORE)).build(); assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; - assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.1"); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.2"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), false); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "instance-store"); @@ -172,7 +172,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { .build(); assert (fastestTemplate.getImage().getProviderId().startsWith("ami-")) : fastestTemplate; assertEquals(fastestTemplate.getHardware().getProviderId(), InstanceType.CC1_4XLARGE); - assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.1"); + assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.2"); assertEquals(fastestTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(fastestTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(fastestTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs"); diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceClientLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceClientLiveTest.java index 5eefc20ac7..fdbf33484b 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceClientLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceClientLiveTest.java @@ -164,7 +164,7 @@ public class SpotInstanceClientLiveTest { start = System.currentTimeMillis(); requests = client.getSpotInstanceServices().requestSpotInstancesInRegion( - "us-west-1", + "us-west-2", 0.09f, 1, LaunchSpecification.builder().imageId("ami-951945d0").instanceType(InstanceType.M1_SMALL).build(), diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3PropertiesBuilder.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3PropertiesBuilder.java index aa89ca406d..9523c8ecda 100644 --- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3PropertiesBuilder.java +++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3PropertiesBuilder.java @@ -23,6 +23,7 @@ import static org.jclouds.aws.domain.Region.AP_NORTHEAST_1; import static org.jclouds.aws.domain.Region.AP_SOUTHEAST_1; import static org.jclouds.aws.domain.Region.US_STANDARD; import static org.jclouds.aws.domain.Region.US_WEST_1; +import static org.jclouds.aws.domain.Region.US_WEST_2; import static org.jclouds.location.reference.LocationConstants.ENDPOINT; import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION; @@ -44,6 +45,7 @@ public class AWSS3PropertiesBuilder extends org.jclouds.s3.S3PropertiesBuilder { properties.setProperty(PROPERTY_ENDPOINT, "https://s3.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + US_STANDARD + "." + ENDPOINT, "https://s3.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + US_WEST_1 + "." + ENDPOINT, "https://s3-us-west-1.amazonaws.com"); + properties.setProperty(PROPERTY_REGION + "." + US_WEST_2 + "." + ENDPOINT, "https://s3-us-west-2.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + "EU" + "." + ENDPOINT, "https://s3-eu-west-1.amazonaws.com"); properties.setProperty(PROPERTY_REGION + "." + AP_SOUTHEAST_1 + "." + ENDPOINT, "https://s3-ap-southeast-1.amazonaws.com"); diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ProviderMetadata.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ProviderMetadata.java index 42a3054639..56e3433e03 100644 --- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ProviderMetadata.java +++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ProviderMetadata.java @@ -111,7 +111,7 @@ public class AWSS3ProviderMetadata extends BaseProviderMetadata { */ @Override public Set getIso3166Codes() { - return ImmutableSet.of("US", "US-CA", "IE", "SG", "JP-13"); + return ImmutableSet.of("US", "US-CA", "US-OR", "IE", "SG", "JP-13"); } } \ No newline at end of file