Issue 747:add new us-west-2 region

This commit is contained in:
Adrian Cole 2011-11-09 11:19:40 +01:00
parent 6d453aa8d8
commit e9cff5e17c
10 changed files with 26 additions and 15 deletions

View File

@ -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);

View File

@ -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<String> DEFAULT_S3 = ImmutableSet.of(EU, US_STANDARD, US_WEST_1, AP_SOUTHEAST_1, AP_NORTHEAST_1);
public static Set<String> DEFAULT_REGIONS = ImmutableSet.of(US_EAST_1, US_WEST_1, EU_WEST_1, AP_SOUTHEAST_1,
public static Set<String> DEFAULT_S3 = ImmutableSet.of(EU, US_STANDARD, US_WEST_1, US_WEST_2, AP_SOUTHEAST_1,
AP_NORTHEAST_1);
public static Set<String> 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");

View File

@ -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",

View File

@ -110,6 +110,6 @@ public class AWSCloudWatchProviderMetadata extends BaseProviderMetadata {
*/
@Override
public Set<String> 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");
}
}

View File

@ -110,7 +110,7 @@ public class AWSEC2ProviderMetadata extends BaseProviderMetadata {
*/
@Override
public Set<String> 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");
}
}

View File

@ -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();

View File

@ -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");

View File

@ -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(),

View File

@ -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");

View File

@ -111,7 +111,7 @@ public class AWSS3ProviderMetadata extends BaseProviderMetadata {
*/
@Override
public Set<String> getIso3166Codes() {
return ImmutableSet.of("US", "US-CA", "IE", "SG", "JP-13");
return ImmutableSet.of("US", "US-CA", "US-OR", "IE", "SG", "JP-13");
}
}