diff --git a/README.txt b/README.txt
index 5a131e5ae8..82d91005e8 100644
--- a/README.txt
+++ b/README.txt
@@ -29,20 +29,21 @@ data.
our current version is 1.0-beta-8
our dev version is 1.0-SNAPSHOT
-our compute api supports: aws-ec2, gogrid, cloudservers (rackspace), vcloud (generic),
+our compute api supports: aws-ec2, gogrid, cloudservers (generic), cloudservers-us,
+ cloudservers-uk, vcloud (generic), ec2 (generic),
trmk-ecloud, trmk-vcloudexpress, eucalyptus (generic),
cloudsigma, elasticstack(generic), bluelock-vclouddirector,
slicehost, ecc-ec2, elastichosts-lon-p (Peer 1),
elastichosts-sat-p (Peer 1), elastichosts-lon-b (BlueSquare),
- ec2 (generic), stub (in-memory)
+ stub (in-memory)
* note * the pom dependency org.jclouds/jclouds-allcompute gives you access to
to all of these providers
-our blobstore api supports: aws-s3, cloudfiles (rackspace), azurestorage, atmosonline,
- synaptic, peer1-storage, s3 (generic), walrus(generic),
- googlestorage, scaleup-storage, ecc-s3, transient (in-mem),
- filesystem (on-disk)
+our blobstore api supports: aws-s3, cloudfiles (generic), cloudfiles-us, cloudfiles-uk,
+ azurestorage, atmosonline (generic), synaptic, peer1-storage,
+ s3 (generic), walrus(generic), googlestorage, scaleup-storage,
+ ecc-s3, transient (in-mem), filesystem (on-disk)
* note * the pom dependency org.jclouds/jclouds-allblobstore gives you access to
to all of these providers
diff --git a/allblobstore/pom.xml b/allblobstore/pom.xml
index 13d1b368d9..935a8581ee 100644
--- a/allblobstore/pom.xml
+++ b/allblobstore/pom.xml
@@ -74,6 +74,16 @@
cloudfiles
${project.version}
+
+ org.jclouds.provider
+ cloudfiles-us
+ ${project.version}
+
+
+ org.jclouds.provider
+ cloudfiles-uk
+ ${project.version}
+
org.jclouds.api
filesystem
diff --git a/allcompute/pom.xml b/allcompute/pom.xml
index 6e9e38dc1c..e30aa8d0a7 100644
--- a/allcompute/pom.xml
+++ b/allcompute/pom.xml
@@ -44,6 +44,16 @@
ec2
${project.version}
+
+ org.jclouds.provider
+ cloudservers-us
+ ${project.version}
+
+
+ org.jclouds.provider
+ cloudservers-uk
+ ${project.version}
+
org.jclouds.api
cloudservers
diff --git a/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/blobstore/config/CloudFilesBlobStoreContextModule.java b/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/blobstore/config/CloudFilesBlobStoreContextModule.java
index da08fc9ac4..b06c628a82 100644
--- a/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/blobstore/config/CloudFilesBlobStoreContextModule.java
+++ b/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/blobstore/config/CloudFilesBlobStoreContextModule.java
@@ -37,7 +37,9 @@ import org.jclouds.cloudfiles.CloudFilesClient;
import org.jclouds.cloudfiles.blobstore.CloudFilesAsyncBlobStore;
import org.jclouds.cloudfiles.blobstore.CloudFilesBlobRequestSigner;
import org.jclouds.cloudfiles.blobstore.CloudFilesBlobStore;
-import org.jclouds.rackspace.config.RackspaceLocationsSupplier;
+import org.jclouds.location.Region;
+import org.jclouds.location.config.ProvideRegionsViaProperties;
+import org.jclouds.location.suppliers.SupplyPredefinedRegions;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
@@ -59,7 +61,7 @@ public class CloudFilesBlobStoreContextModule extends AbstractModule {
protected void configure() {
install(new BlobStoreMapModule());
bind(new TypeLiteral>>() {
- }).annotatedWith(Memoized.class).to(new TypeLiteral() {
+ }).annotatedWith(Memoized.class).to(new TypeLiteral() {
});
bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT);
@@ -68,6 +70,8 @@ public class CloudFilesBlobStoreContextModule extends AbstractModule {
bind(BlobStoreContext.class).to(new TypeLiteral>() {
}).in(Scopes.SINGLETON);
bind(BlobRequestSigner.class).to(CloudFilesBlobRequestSigner.class);
+ bind(new TypeLiteral>() {
+ }).annotatedWith(Region.class).toProvider(ProvideRegionsViaProperties.class).in(Scopes.SINGLETON);
}
@Provides
diff --git a/apis/cloudfiles/src/test/resources/log4j.xml b/apis/cloudfiles/src/test/resources/log4j.xml
index 5b548a0f48..28a3549778 100755
--- a/apis/cloudfiles/src/test/resources/log4j.xml
+++ b/apis/cloudfiles/src/test/resources/log4j.xml
@@ -81,58 +81,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -158,10 +106,6 @@
-
-
-
-
@@ -170,10 +114,7 @@
-
-
-
-
+
diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersBindComputeSuppliersByClass.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersBindComputeSuppliersByClass.java
index 68e1cfdf33..ba33a9b224 100644
--- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersBindComputeSuppliersByClass.java
+++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersBindComputeSuppliersByClass.java
@@ -27,7 +27,7 @@ import org.jclouds.compute.domain.Image;
import org.jclouds.domain.Location;
import org.jclouds.cloudservers.compute.suppliers.CloudServersHardwareSupplier;
import org.jclouds.cloudservers.compute.suppliers.CloudServersImageSupplier;
-import org.jclouds.rackspace.config.RackspaceLocationsSupplier;
+import org.jclouds.location.suppliers.SupplyPredefinedRegions;
import com.google.common.base.Supplier;
@@ -49,6 +49,6 @@ public class CloudServersBindComputeSuppliersByClass extends BindComputeSupplier
@Override
protected Class extends Supplier>> defineLocationSupplier() {
- return RackspaceLocationsSupplier.class;
+ return SupplyPredefinedRegions.class;
}
}
diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersComputeServiceDependenciesModule.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersComputeServiceDependenciesModule.java
index f99223d13c..684b7517f1 100644
--- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersComputeServiceDependenciesModule.java
+++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/config/CloudServersComputeServiceDependenciesModule.java
@@ -20,17 +20,10 @@
package org.jclouds.cloudservers.compute.config;
import java.util.Map;
+import java.util.Set;
import javax.inject.Singleton;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeState;
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.compute.internal.BaseComputeService;
-import org.jclouds.compute.internal.ComputeServiceContextImpl;
import org.jclouds.cloudservers.CloudServersAsyncClient;
import org.jclouds.cloudservers.CloudServersClient;
import org.jclouds.cloudservers.compute.functions.CloudServersImageToImage;
@@ -40,6 +33,16 @@ import org.jclouds.cloudservers.compute.functions.ServerToNodeMetadata;
import org.jclouds.cloudservers.domain.Flavor;
import org.jclouds.cloudservers.domain.Server;
import org.jclouds.cloudservers.domain.ServerStatus;
+import org.jclouds.compute.ComputeServiceContext;
+import org.jclouds.compute.domain.Hardware;
+import org.jclouds.compute.domain.Image;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.jclouds.compute.domain.NodeState;
+import org.jclouds.compute.domain.OperatingSystem;
+import org.jclouds.compute.internal.BaseComputeService;
+import org.jclouds.compute.internal.ComputeServiceContextImpl;
+import org.jclouds.location.Region;
+import org.jclouds.location.config.ProvideRegionsViaProperties;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.RestContextImpl;
@@ -79,6 +82,8 @@ public class CloudServersComputeServiceDependenciesModule extends AbstractModule
bind(new TypeLiteral>() {
}).to(new TypeLiteral>() {
}).in(Scopes.SINGLETON);
+ bind(new TypeLiteral>() {
+ }).annotatedWith(Region.class).toProvider(ProvideRegionsViaProperties.class).in(Scopes.SINGLETON);
}
@VisibleForTesting
diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java
index 8067c9c2fd..309fb0bd4f 100644
--- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java
+++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java
@@ -36,13 +36,6 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.jclouds.Constants;
-import org.jclouds.domain.Credentials;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.io.Payload;
-import org.jclouds.logging.log4j.config.Log4JLoggingModule;
-import org.jclouds.net.IPSocket;
-import org.jclouds.predicates.RetryablePredicate;
-import org.jclouds.predicates.SocketOpen;
import org.jclouds.cloudservers.domain.BackupSchedule;
import org.jclouds.cloudservers.domain.DailyBackup;
import org.jclouds.cloudservers.domain.Flavor;
@@ -54,6 +47,13 @@ import org.jclouds.cloudservers.domain.ServerStatus;
import org.jclouds.cloudservers.domain.SharedIpGroup;
import org.jclouds.cloudservers.domain.WeeklyBackup;
import org.jclouds.cloudservers.options.RebuildServerOptions;
+import org.jclouds.domain.Credentials;
+import org.jclouds.http.HttpResponseException;
+import org.jclouds.io.Payload;
+import org.jclouds.logging.log4j.config.Log4JLoggingModule;
+import org.jclouds.net.IPSocket;
+import org.jclouds.predicates.RetryablePredicate;
+import org.jclouds.predicates.SocketOpen;
import org.jclouds.rest.RestContextFactory;
import org.jclouds.ssh.ExecResponse;
import org.jclouds.ssh.SshClient;
@@ -93,9 +93,8 @@ public class CloudServersClientLiveTest {
identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity");
credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider
+ ".credential");
- endpoint = checkNotNull(System.getProperty("test." + provider + ".endpoint"), "test." + provider + ".endpoint");
- apiversion = checkNotNull(System.getProperty("test." + provider + ".apiversion"), "test." + provider
- + ".apiversion");
+ endpoint = System.getProperty("test." + provider + ".endpoint");
+ apiversion = System.getProperty("test." + provider + ".apiversion");
}
protected Properties setupProperties() {
@@ -104,8 +103,10 @@ public class CloudServersClientLiveTest {
overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
overrides.setProperty(provider + ".identity", identity);
overrides.setProperty(provider + ".credential", credential);
- overrides.setProperty(provider + ".endpoint", endpoint);
- overrides.setProperty(provider + ".apiversion", apiversion);
+ if (endpoint != null)
+ overrides.setProperty(provider + ".endpoint", endpoint);
+ if (apiversion != null)
+ overrides.setProperty(provider + ".apiversion", apiversion);
return overrides;
}
diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java
index c9c61b1bcb..c273796282 100644
--- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java
+++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java
@@ -19,19 +19,16 @@
package org.jclouds.cloudservers.compute;
-import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
+import org.jclouds.cloudservers.CloudServersAsyncClient;
+import org.jclouds.cloudservers.CloudServersClient;
import org.jclouds.compute.BaseComputeServiceLiveTest;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.Template;
import org.jclouds.domain.LocationScope;
-import org.jclouds.cloudservers.CloudServersAsyncClient;
-import org.jclouds.cloudservers.CloudServersClient;
import org.jclouds.rest.RestContext;
import org.jclouds.ssh.jsch.config.JschSshClientModule;
import org.testng.annotations.Test;
@@ -48,16 +45,6 @@ public class CloudServersComputeServiceLiveTest extends BaseComputeServiceLiveTe
provider = "cloudservers";
}
- @Test
- public void testTemplateBuilder() {
- Template defaultTemplate = client.templateBuilder().build();
- assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "10.04");
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
- assertEquals(defaultTemplate.getLocation().getId(), "DFW1");
- assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
- }
-
@Override
protected JschSshClientModule getSshModule() {
return new JschSshClientModule();
diff --git a/blobstore/src/main/clojure/org/jclouds/blobstore.clj b/blobstore/src/main/clojure/org/jclouds/blobstore.clj
index c9ec4ae62e..1840c6f2a0 100644
--- a/blobstore/src/main/clojure/org/jclouds/blobstore.clj
+++ b/blobstore/src/main/clojure/org/jclouds/blobstore.clj
@@ -22,7 +22,8 @@
Current supported services are:
[transient, filesystem, s3, azureblob, atmos, cloudfiles, walrus,
- googlestorage, synaptic, peer1-storage, aws-s3, ecc-s3]
+ googlestorage, synaptic, peer1-storage, aws-s3, ecc-s3, cloudfiles-us,
+ cloufiles-uk]
Here's a quick example of how to viewresources in rackspace
diff --git a/common/aws/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java b/common/aws/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java
index a67897a711..06075ba138 100644
--- a/common/aws/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java
+++ b/common/aws/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java
@@ -38,7 +38,7 @@ import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.location.Provider;
import org.jclouds.location.Region;
-import org.jclouds.location.config.ProvideRegionsViaProperties;
+import org.jclouds.location.config.ProvideRegionToURIViaProperties;
import org.jclouds.logging.Logger.LoggerFactory;
import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.config.RestClientModule;
@@ -91,7 +91,7 @@ public class AWSRestClientModule extends RestClientModule {
}
protected void bindRegionsToProvider() {
- bindRegionsToProvider(ProvideRegionsViaProperties.class);
+ bindRegionsToProvider(ProvideRegionToURIViaProperties.class);
}
@Override
diff --git a/common/rackspace/src/main/java/org/jclouds/rackspace/RackspacePropertiesBuilder.java b/common/rackspace/src/main/java/org/jclouds/rackspace/RackspacePropertiesBuilder.java
index f8a465ad99..abbcef4017 100644
--- a/common/rackspace/src/main/java/org/jclouds/rackspace/RackspacePropertiesBuilder.java
+++ b/common/rackspace/src/main/java/org/jclouds/rackspace/RackspacePropertiesBuilder.java
@@ -21,6 +21,7 @@ package org.jclouds.rackspace;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
+import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties;
@@ -35,6 +36,7 @@ public class RackspacePropertiesBuilder extends PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
+ properties.setProperty(PROPERTY_REGIONS, "US");
properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_API_VERSION, RackspaceAuthAsyncClient.VERSION);
return properties;
diff --git a/compute/src/main/clojure/org/jclouds/compute.clj b/compute/src/main/clojure/org/jclouds/compute.clj
index 8fed275929..2b30af6b05 100644
--- a/compute/src/main/clojure/org/jclouds/compute.clj
+++ b/compute/src/main/clojure/org/jclouds/compute.clj
@@ -21,9 +21,10 @@
"A clojure binding to the jclouds ComputeService.
Current supported providers are:
- [ec2, aws-ec2, ecc-ec2, cloudservers, trmk-ecloud, trmk-vcloudexpress, vcloud,
- bluelock, eucalyptus, slicehost, elastichosts-lon-p, elastichosts-sat-p,
- elastichosts, elastichosts-lon-b, cloudsigma, stub]
+ [ec2, aws-ec2, ecc-ec2, cloudservers, cloudservers-uk, cloudservers-us,
+ trmk-ecloud, trmk-vcloudexpress, vcloud, bluelock, eucalyptus,
+ slicehost, elastichosts-lon-p, elastichosts-sat-p, elastichosts,
+ elastichosts-lon-b, cloudsigma, stub]
Here's an example of getting some compute configuration from rackspace:
diff --git a/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java b/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java
new file mode 100644
index 0000000000..3c5efaf94e
--- /dev/null
+++ b/core/src/main/java/org/jclouds/location/config/ProvideRegionToURIViaProperties.java
@@ -0,0 +1,80 @@
+/**
+ *
+ * Copyright (C) 2010 Cloud Conscious, LLC.
+ *
+ * ====================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.jclouds.location.config;
+
+import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION;
+import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
+
+import java.net.URI;
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jclouds.location.Provider;
+import org.jclouds.location.Region;
+
+import com.google.common.base.Splitter;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+import com.google.inject.ConfigurationException;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.name.Names;
+
+/**
+ *
+ * looks for properties bound to the naming convention jclouds.location.region.{@code regionId}.endpoint
+ *
+ * @author Adrian Cole
+ */
+@Singleton
+public class ProvideRegionToURIViaProperties implements javax.inject.Provider