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>> 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> { + + private final Injector injector; + + @Inject + ProvideRegionToURIViaProperties(Injector injector) { + this.injector = injector; + } + + @Singleton + @Region + @Override + public Map get() { + try { + String regionString = injector.getInstance(Key.get(String.class, Names.named(PROPERTY_REGIONS))); + Builder regions = ImmutableMap. builder(); + for (String region : Splitter.on(',').split(regionString)) { + regions.put( + region, + URI.create(injector.getInstance(Key.get(String.class, + Names.named(PROPERTY_REGION + "." + region + ".endpoint"))))); + } + return regions.build(); + } catch (ConfigurationException e) { + // this happens if regions property isn't set + // services not run by AWS may not have regions, so this is ok. + return ImmutableMap.of(injector.getInstance(Key.get(String.class, Provider.class)), + injector.getInstance(Key.get(URI.class, Provider.class))); + } + } + +} \ No newline at end of file diff --git a/core/src/main/java/org/jclouds/location/config/ProvideRegionsViaProperties.java b/core/src/main/java/org/jclouds/location/config/ProvideRegionsViaProperties.java index 275b2085f7..534951e85c 100644 --- a/core/src/main/java/org/jclouds/location/config/ProvideRegionsViaProperties.java +++ b/core/src/main/java/org/jclouds/location/config/ProvideRegionsViaProperties.java @@ -19,62 +19,38 @@ 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 java.util.Set; import javax.inject.Inject; +import javax.inject.Named; 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; +import com.google.common.collect.ImmutableSet; /** - * - * looks for properties bound to the naming convention jclouds.location.region.{@code regionId}.endpoint * * @author Adrian Cole */ @Singleton -public class ProvideRegionsViaProperties implements javax.inject.Provider> { +public class ProvideRegionsViaProperties implements javax.inject.Provider> { - private final Injector injector; + private final Set regions; @Inject - ProvideRegionsViaProperties(Injector injector) { - this.injector = injector; + ProvideRegionsViaProperties(@Named(PROPERTY_REGIONS) String regions) { + this.regions = ImmutableSet.copyOf(Splitter.on(',').split(regions)); } @Singleton @Region @Override - public Map get() { - try { - String regionString = injector.getInstance(Key.get(String.class, Names.named(PROPERTY_REGIONS))); - Builder regions = ImmutableMap. builder(); - for (String region : Splitter.on(',').split(regionString)) { - regions.put( - region, - URI.create(injector.getInstance(Key.get(String.class, - Names.named(PROPERTY_REGION + "." + region + ".endpoint"))))); - } - return regions.build(); - } catch (ConfigurationException e) { - // this happens if regions property isn't set - // services not run by AWS may not have regions, so this is ok. - return ImmutableMap.of(injector.getInstance(Key.get(String.class, Provider.class)), - injector.getInstance(Key.get(URI.class, Provider.class))); - } + public Set get() { + return regions; } } \ No newline at end of file diff --git a/common/rackspace/src/main/java/org/jclouds/rackspace/config/RackspaceLocationsSupplier.java b/core/src/main/java/org/jclouds/location/suppliers/SupplyPredefinedRegions.java similarity index 62% rename from common/rackspace/src/main/java/org/jclouds/rackspace/config/RackspaceLocationsSupplier.java rename to core/src/main/java/org/jclouds/location/suppliers/SupplyPredefinedRegions.java index da213ee524..98c50a55be 100644 --- a/common/rackspace/src/main/java/org/jclouds/rackspace/config/RackspaceLocationsSupplier.java +++ b/core/src/main/java/org/jclouds/location/suppliers/SupplyPredefinedRegions.java @@ -17,37 +17,48 @@ * ==================================================================== */ -package org.jclouds.rackspace.config; +package org.jclouds.location.suppliers; +import java.net.URI; import java.util.Set; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.domain.Location; import org.jclouds.domain.LocationScope; import org.jclouds.domain.internal.LocationImpl; import org.jclouds.location.Provider; +import org.jclouds.location.Region; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSet.Builder; /** - * Configures the locations used in Rackspace services * * @author Adrian Cole */ -public class RackspaceLocationsSupplier implements Supplier> { - +@Singleton +public class SupplyPredefinedRegions implements Supplier> { + private final Set regions; private final String providerName; + private final URI endpoint; @Inject - RackspaceLocationsSupplier(@Provider String providerName) { + SupplyPredefinedRegions(@Region Set regions, @Provider String providerName, @Provider URI endpoint) { + this.regions = regions; this.providerName = providerName; + this.endpoint = endpoint; } @Override public Set get() { - Location provider = new LocationImpl(LocationScope.PROVIDER, providerName, providerName, null); - return ImmutableSet.of(new LocationImpl(LocationScope.ZONE, "DFW1", "Dallas, TX", provider)); + Builder locations = ImmutableSet.builder(); + Location provider = new LocationImpl(LocationScope.PROVIDER, providerName, endpoint.toASCIIString(), null); + for (String zone : regions) { + locations.add(new LocationImpl(LocationScope.REGION, zone.toString(), zone.toString(), provider)); + } + return locations.build(); } } \ No newline at end of file diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties index 1e5f577eee..0f4dbceee2 100644 --- a/core/src/main/resources/rest.properties +++ b/core/src/main/resources/rest.properties @@ -101,6 +101,12 @@ nova-ec2.propertiesbuilder=org.jclouds.nova.ec2.NovaEC2PropertiesBuilder cloudservers.contextbuilder=org.jclouds.cloudservers.CloudServersContextBuilder cloudservers.propertiesbuilder=org.jclouds.rackspace.RackspacePropertiesBuilder +cloudservers-uk.contextbuilder=org.jclouds.cloudservers.CloudServersContextBuilder +cloudservers-uk.propertiesbuilder=org.jclouds.rackspace.cloudservers.CloudServersUKPropertiesBuilder + +cloudservers-us.contextbuilder=org.jclouds.cloudservers.CloudServersContextBuilder +cloudservers-us.propertiesbuilder=org.jclouds.rackspace.cloudservers.CloudServersUSPropertiesBuilder + bluelock-vcdirector.contextbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloudDirectorContextBuilder bluelock-vcdirector.propertiesbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloudDirectorPropertiesBuilder @@ -156,6 +162,12 @@ peer1-storage.apiversion=1.3.0 cloudfiles.contextbuilder=org.jclouds.cloudfiles.CloudFilesContextBuilder cloudfiles.propertiesbuilder=org.jclouds.cloudfiles.CloudFilesPropertiesBuilder +cloudfiles-us.contextbuilder=org.jclouds.cloudfiles.CloudFilesContextBuilder +cloudfiles-us.propertiesbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesUSPropertiesBuilder + +cloudfiles-uk.contextbuilder=org.jclouds.cloudfiles.CloudFilesContextBuilder +cloudfiles-uk.propertiesbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesUKPropertiesBuilder + walrus.contextbuilder=org.jclouds.s3.S3ContextBuilder walrus.propertiesbuilder=org.jclouds.walrus.WalrusPropertiesBuilder diff --git a/providers/cloudfiles-uk/pom.xml b/providers/cloudfiles-uk/pom.xml new file mode 100644 index 0000000000..09920314bf --- /dev/null +++ b/providers/cloudfiles-uk/pom.xml @@ -0,0 +1,144 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + cloudfiles-uk + jclouds CloudFiles UK provider + CloudFiles implementation targeted to Rackspace UK + + + org.jclouds.rackspace.cloudfiles.blobstore.integration.CloudFilesUKTestInitializer + https://lon.auth.api.rackspacecloud.com + 1.0 + ${test.rackspace-uk.identity} + ${test.rackspace-uk.credential} + + + + + org.jclouds.api + cloudfiles + ${project.version} + jar + + + org.jclouds.api + cloudfiles + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-blobstore + ${project.version} + test-jar + test + + + org.jclouds + jclouds-log4j + ${project.version} + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.cloudfiles-uk.endpoint + ${test.cloudfiles-uk.endpoint} + + + test.cloudfiles-uk.apiversion + ${test.cloudfiles-uk.apiversion} + + + test.cloudfiles-uk.identity + ${test.cloudfiles-uk.identity} + + + test.cloudfiles-uk.credential + ${test.cloudfiles-uk.credential} + + + test.initializer + ${test.initializer} + + + jclouds.blobstore.httpstream.url + ${jclouds.blobstore.httpstream.url} + + + jclouds.blobstore.httpstream.md5 + ${jclouds.blobstore.httpstream.md5} + + + + + + + + + + + + + + diff --git a/providers/cloudfiles-uk/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesUKPropertiesBuilder.java b/providers/cloudfiles-uk/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesUKPropertiesBuilder.java new file mode 100644 index 0000000000..ef037347a6 --- /dev/null +++ b/providers/cloudfiles-uk/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesUKPropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * 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.rackspace.cloudfiles; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; + +import java.util.Properties; + +import org.jclouds.cloudfiles.CloudFilesPropertiesBuilder; + +/** + * + * @author Adrian Cole + */ +public class CloudFilesUKPropertiesBuilder extends CloudFilesPropertiesBuilder { + + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_REGIONS, "UK"); + properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com"); + return properties; + } + + public CloudFilesUKPropertiesBuilder(Properties properties) { + super(properties); + } + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/CloudFilesUKClientLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/CloudFilesUKClientLiveTest.java new file mode 100644 index 0000000000..fc234ef4a0 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/CloudFilesUKClientLiveTest.java @@ -0,0 +1,33 @@ +/** + * + * 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.rackspace.cloudfiles; + +import org.jclouds.cloudfiles.CloudFilesClientLiveTest; +import org.testng.annotations.Test; + +/** + * Tests behavior of {@code CloudFilesClient} + * + * @author Adrian Cole + */ +@Test(groups = "live", sequential = true, testName = "CloudFilesUKClientLiveTest") +public class CloudFilesUKClientLiveTest extends CloudFilesClientLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobIntegrationLiveTest.java new file mode 100644 index 0000000000..46702ec1db --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobIntegrationLiveTest.java @@ -0,0 +1,32 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKBlobIntegrationLiveTest") +public class CloudFilesUKBlobIntegrationLiveTest extends CloudFilesBlobIntegrationLiveTest { + + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobLiveTest.java new file mode 100644 index 0000000000..9109a36bd9 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKBlobLiveTest") +public class CloudFilesUKBlobLiveTest extends CloudFilesBlobLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java new file mode 100644 index 0000000000..2c9eb336bb --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobMapIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobMapIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKBlobMapIntegrationLiveTest") +public class CloudFilesUKBlobMapIntegrationLiveTest extends CloudFilesBlobMapIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobSignerLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobSignerLiveTest.java new file mode 100644 index 0000000000..beeeefdb67 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKBlobSignerLiveTest.java @@ -0,0 +1,32 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobSignerLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKBlobSignerLiveTest") +public class CloudFilesUKBlobSignerLiveTest extends CloudFilesBlobSignerLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKContainerIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKContainerIntegrationLiveTest.java new file mode 100644 index 0000000000..f42f0b0fe3 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKContainerIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesContainerIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKContainerIntegrationLiveTest") +public class CloudFilesUKContainerIntegrationLiveTest extends CloudFilesContainerIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKContainerLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKContainerLiveTest.java new file mode 100644 index 0000000000..9db18199d7 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKContainerLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesContainerLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKContainerLiveTest") +public class CloudFilesUKContainerLiveTest extends CloudFilesContainerLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java new file mode 100644 index 0000000000..5a825bb8c2 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKInputStreamMapIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesInputStreamMapIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKInputStreamMapIntegrationLiveTest") +public class CloudFilesUKInputStreamMapIntegrationLiveTest extends CloudFilesInputStreamMapIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKServiceIntegrationLiveTest.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKServiceIntegrationLiveTest.java new file mode 100644 index 0000000000..51f682cadb --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKServiceIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesServiceIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUKServiceIntegrationLiveTest") +public class CloudFilesUKServiceIntegrationLiveTest extends CloudFilesServiceIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKTestInitializer.java b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKTestInitializer.java new file mode 100644 index 0000000000..ae2511c567 --- /dev/null +++ b/providers/cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUKTestInitializer.java @@ -0,0 +1,33 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesTestInitializer; + +/** + * + * @author Adrian Cole + */ +public class CloudFilesUKTestInitializer extends CloudFilesTestInitializer { + + public CloudFilesUKTestInitializer() { + provider = "cloudfiles-uk"; + } +} diff --git a/providers/cloudfiles-us/pom.xml b/providers/cloudfiles-us/pom.xml new file mode 100644 index 0000000000..75f4e49632 --- /dev/null +++ b/providers/cloudfiles-us/pom.xml @@ -0,0 +1,144 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + cloudfiles-us + jclouds CloudFiles US provider + CloudFiles implementation targeted to Rackspace US + + + org.jclouds.rackspace.cloudfiles.blobstore.integration.CloudFilesUSTestInitializer + https://auth.api.rackspacecloud.com + 1.0 + ${test.rackspace-us.identity} + ${test.rackspace-us.credential} + + + + + org.jclouds.api + cloudfiles + ${project.version} + jar + + + org.jclouds.api + cloudfiles + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-blobstore + ${project.version} + test-jar + test + + + org.jclouds + jclouds-log4j + ${project.version} + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.cloudfiles-us.endpoint + ${test.cloudfiles-us.endpoint} + + + test.cloudfiles-us.apiversion + ${test.cloudfiles-us.apiversion} + + + test.cloudfiles-us.identity + ${test.cloudfiles-us.identity} + + + test.cloudfiles-us.credential + ${test.cloudfiles-us.credential} + + + test.initializer + ${test.initializer} + + + jclouds.blobstore.httpstream.url + ${jclouds.blobstore.httpstream.url} + + + jclouds.blobstore.httpstream.md5 + ${jclouds.blobstore.httpstream.md5} + + + + + + + + + + + + + + diff --git a/providers/cloudfiles-us/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesUSPropertiesBuilder.java b/providers/cloudfiles-us/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesUSPropertiesBuilder.java new file mode 100644 index 0000000000..5144acb5fb --- /dev/null +++ b/providers/cloudfiles-us/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesUSPropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * 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.rackspace.cloudfiles; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; + +import java.util.Properties; + +import org.jclouds.cloudfiles.CloudFilesPropertiesBuilder; + +/** + * + * @author Adrian Cole + */ +public class CloudFilesUSPropertiesBuilder extends CloudFilesPropertiesBuilder { + + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_REGIONS, "US"); + properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com"); + return properties; + } + + public CloudFilesUSPropertiesBuilder(Properties properties) { + super(properties); + } + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/CloudFilesUSClientLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/CloudFilesUSClientLiveTest.java new file mode 100644 index 0000000000..d4005a194b --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/CloudFilesUSClientLiveTest.java @@ -0,0 +1,33 @@ +/** + * + * 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.rackspace.cloudfiles; + +import org.jclouds.cloudfiles.CloudFilesClientLiveTest; +import org.testng.annotations.Test; + +/** + * Tests behavior of {@code CloudFilesClient} + * + * @author Adrian Cole + */ +@Test(groups = "live", sequential = true, testName = "CloudFilesUSClientLiveTest") +public class CloudFilesUSClientLiveTest extends CloudFilesClientLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobIntegrationLiveTest.java new file mode 100644 index 0000000000..3b287b5432 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobIntegrationLiveTest.java @@ -0,0 +1,32 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSBlobIntegrationLiveTest") +public class CloudFilesUSBlobIntegrationLiveTest extends CloudFilesBlobIntegrationLiveTest { + + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobLiveTest.java new file mode 100644 index 0000000000..59d0103527 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSBlobLiveTest") +public class CloudFilesUSBlobLiveTest extends CloudFilesBlobLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java new file mode 100644 index 0000000000..1540ef9bd4 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobMapIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobMapIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSBlobMapIntegrationLiveTest") +public class CloudFilesUSBlobMapIntegrationLiveTest extends CloudFilesBlobMapIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobSignerLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobSignerLiveTest.java new file mode 100644 index 0000000000..0541046fb0 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSBlobSignerLiveTest.java @@ -0,0 +1,32 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesBlobSignerLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSBlobSignerLiveTest") +public class CloudFilesUSBlobSignerLiveTest extends CloudFilesBlobSignerLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSContainerIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSContainerIntegrationLiveTest.java new file mode 100644 index 0000000000..db03070640 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSContainerIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesContainerIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSContainerIntegrationLiveTest") +public class CloudFilesUSContainerIntegrationLiveTest extends CloudFilesContainerIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSContainerLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSContainerLiveTest.java new file mode 100644 index 0000000000..b7cb9150d3 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSContainerLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesContainerLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSContainerLiveTest") +public class CloudFilesUSContainerLiveTest extends CloudFilesContainerLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java new file mode 100644 index 0000000000..84f4121398 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSInputStreamMapIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesInputStreamMapIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSInputStreamMapIntegrationLiveTest") +public class CloudFilesUSInputStreamMapIntegrationLiveTest extends CloudFilesInputStreamMapIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSServiceIntegrationLiveTest.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSServiceIntegrationLiveTest.java new file mode 100644 index 0000000000..593a343890 --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSServiceIntegrationLiveTest.java @@ -0,0 +1,31 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesServiceIntegrationLiveTest; +import org.testng.annotations.Test; + +/** + * @author Adrian Cole + */ +@Test(groups = "live", testName = "CloudFilesUSServiceIntegrationLiveTest") +public class CloudFilesUSServiceIntegrationLiveTest extends CloudFilesServiceIntegrationLiveTest { + +} diff --git a/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSTestInitializer.java b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSTestInitializer.java new file mode 100644 index 0000000000..0e63ec20fc --- /dev/null +++ b/providers/cloudfiles-us/src/test/java/org/jclouds/rackspace/cloudfiles/blobstore/integration/CloudFilesUSTestInitializer.java @@ -0,0 +1,33 @@ +/** + * + * 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.rackspace.cloudfiles.blobstore.integration; + +import org.jclouds.cloudfiles.blobstore.integration.CloudFilesTestInitializer; + +/** + * + * @author Adrian Cole + */ +public class CloudFilesUSTestInitializer extends CloudFilesTestInitializer { + + public CloudFilesUSTestInitializer() { + provider = "cloudfiles-us"; + } +} diff --git a/providers/cloudservers-uk/pom.xml b/providers/cloudservers-uk/pom.xml new file mode 100644 index 0000000000..68f8884d8e --- /dev/null +++ b/providers/cloudservers-uk/pom.xml @@ -0,0 +1,141 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + cloudservers-uk + jclouds CloudServers UK provider + CloudServers implementation targeted to Rackspace UK + + + https://lon.auth.api.rackspacecloud.com + 1.0 + ${test.rackspace-uk.identity} + ${test.rackspace-uk.credential} + + + + + org.jclouds.common + rackspace-common + ${project.version} + + + org.jclouds.api + cloudservers + ${project.version} + + + org.jclouds.api + cloudservers + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-compute + ${project.version} + test-jar + test + + + org.jclouds + jclouds-log4j + ${project.version} + test + + + org.jclouds + jclouds-jsch + ${project.version} + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.cloudservers-uk.endpoint + ${test.cloudservers-uk.endpoint} + + + test.cloudservers-uk.apiversion + ${test.cloudservers-uk.apiversion} + + + test.cloudservers-uk.identity + ${test.cloudservers-uk.identity} + + + test.cloudservers-uk.credential + ${test.cloudservers-uk.credential} + + + + + + + + + + + + + + diff --git a/providers/cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUKPropertiesBuilder.java b/providers/cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUKPropertiesBuilder.java new file mode 100644 index 0000000000..47cd0363d4 --- /dev/null +++ b/providers/cloudservers-uk/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUKPropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * 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.rackspace.cloudservers; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; + +import java.util.Properties; + +import org.jclouds.rackspace.RackspacePropertiesBuilder; + +/** + * + * @author Adrian Cole + */ +public class CloudServersUKPropertiesBuilder extends RackspacePropertiesBuilder { + + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_REGIONS, "UK"); + properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com"); + return properties; + } + + public CloudServersUKPropertiesBuilder(Properties properties) { + super(properties); + } + +} diff --git a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersUKClientLiveTest.java b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersUKClientLiveTest.java new file mode 100644 index 0000000000..8740e1e998 --- /dev/null +++ b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersUKClientLiveTest.java @@ -0,0 +1,34 @@ +/** + * + * 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.rackspace.cloudservers; + +import org.jclouds.cloudservers.CloudServersClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", sequential = true) +public class CloudServersUKClientLiveTest extends CloudServersClientLiveTest { + public CloudServersUKClientLiveTest() { + provider = "cloudservers-uk"; + } +} diff --git a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKComputeServiceLiveTest.java b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKComputeServiceLiveTest.java new file mode 100644 index 0000000000..44c8307490 --- /dev/null +++ b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKComputeServiceLiveTest.java @@ -0,0 +1,37 @@ +/** + * + * 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.rackspace.cloudservers.compute; + +import org.jclouds.cloudservers.compute.CloudServersComputeServiceLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", sequential = true, testName = "CloudServersUKComputeServiceLiveTest") +public class CloudServersUKComputeServiceLiveTest extends CloudServersComputeServiceLiveTest { + + public CloudServersUKComputeServiceLiveTest() { + provider = "cloudservers-uk"; + tag = "cs"; + } + +} diff --git a/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java new file mode 100644 index 0000000000..bcd71630f6 --- /dev/null +++ b/providers/cloudservers-uk/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUKTemplateBuilderLiveTest.java @@ -0,0 +1,71 @@ +/** + * + * 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.rackspace.cloudservers.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import org.jclouds.compute.BaseTemplateBuilderLiveTest; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.os.OsFamilyVersion64Bit; +import org.testng.annotations.Test; + +import com.google.common.base.Predicate; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live") +public class CloudServersUKTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { + + public CloudServersUKTemplateBuilderLiveTest() { + provider = "cloudservers-uk"; + } + + @Override + protected Predicate defineUnsupportedOperatingSystems() { + return new Predicate() { + + @Override + public boolean apply(OsFamilyVersion64Bit input) { + return (input.family != OsFamily.WINDOWS && !input.is64Bit) || // + input.family == OsFamily.RHEL || // + (input.family == OsFamily.UBUNTU && input.version.equals("11.04")) || // + (input.family == OsFamily.CENTOS && input.version.matches("5.[23]")) || // + (input.family == OsFamily.WINDOWS && input.version.equals("2008")) || // + (input.family == OsFamily.WINDOWS && input.version.equals("2008 R2") && !input.is64Bit); + } + + }; + } + + @Test + public void testTemplateBuilder() { + Template defaultTemplate = this.context.getComputeService().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(), "UK"); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + } + +} diff --git a/providers/cloudservers-us/pom.xml b/providers/cloudservers-us/pom.xml new file mode 100644 index 0000000000..8e06e8f701 --- /dev/null +++ b/providers/cloudservers-us/pom.xml @@ -0,0 +1,141 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + cloudservers-us + jclouds CloudServers US provider + CloudServers implementation targeted to Rackspace US + + + https://auth.api.rackspacecloud.com + 1.0 + ${test.rackspace-us.identity} + ${test.rackspace-us.credential} + + + + + org.jclouds.common + rackspace-common + ${project.version} + + + org.jclouds.api + cloudservers + ${project.version} + + + org.jclouds.api + cloudservers + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-compute + ${project.version} + test-jar + test + + + org.jclouds + jclouds-log4j + ${project.version} + test + + + org.jclouds + jclouds-jsch + ${project.version} + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.cloudservers-us.endpoint + ${test.cloudservers-us.endpoint} + + + test.cloudservers-us.apiversion + ${test.cloudservers-us.apiversion} + + + test.cloudservers-us.identity + ${test.cloudservers-us.identity} + + + test.cloudservers-us.credential + ${test.cloudservers-us.credential} + + + + + + + + + + + + + + diff --git a/providers/cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUSPropertiesBuilder.java b/providers/cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUSPropertiesBuilder.java new file mode 100644 index 0000000000..490db8ca92 --- /dev/null +++ b/providers/cloudservers-us/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersUSPropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * 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.rackspace.cloudservers; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; + +import java.util.Properties; + +import org.jclouds.rackspace.RackspacePropertiesBuilder; + +/** + * + * @author Adrian Cole + */ +public class CloudServersUSPropertiesBuilder extends RackspacePropertiesBuilder { + + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_REGIONS, "US"); + properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com"); + return properties; + } + + public CloudServersUSPropertiesBuilder(Properties properties) { + super(properties); + } + +} diff --git a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersUSClientLiveTest.java b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersUSClientLiveTest.java new file mode 100644 index 0000000000..3b3456bda7 --- /dev/null +++ b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersUSClientLiveTest.java @@ -0,0 +1,34 @@ +/** + * + * 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.rackspace.cloudservers; + +import org.jclouds.cloudservers.CloudServersClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", sequential = true) +public class CloudServersUSClientLiveTest extends CloudServersClientLiveTest { + public CloudServersUSClientLiveTest() { + provider = "cloudservers-us"; + } +} diff --git a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSComputeServiceLiveTest.java b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSComputeServiceLiveTest.java new file mode 100644 index 0000000000..6ba4037c67 --- /dev/null +++ b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSComputeServiceLiveTest.java @@ -0,0 +1,37 @@ +/** + * + * 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.rackspace.cloudservers.compute; + +import org.jclouds.cloudservers.compute.CloudServersComputeServiceLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", sequential = true, testName = "CloudServersUSComputeServiceLiveTest") +public class CloudServersUSComputeServiceLiveTest extends CloudServersComputeServiceLiveTest { + + public CloudServersUSComputeServiceLiveTest() { + provider = "cloudservers-us"; + tag = "cs"; + } + +} diff --git a/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java new file mode 100644 index 0000000000..c58e96e237 --- /dev/null +++ b/providers/cloudservers-us/src/test/java/org/jclouds/rackspace/cloudservers/compute/CloudServersUSTemplateBuilderLiveTest.java @@ -0,0 +1,70 @@ +/** + * + * 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.rackspace.cloudservers.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import org.jclouds.compute.BaseTemplateBuilderLiveTest; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.os.OsFamilyVersion64Bit; +import org.testng.annotations.Test; + +import com.google.common.base.Predicate; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live") +public class CloudServersUSTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { + + public CloudServersUSTemplateBuilderLiveTest() { + provider = "cloudservers-us"; + } + + @Override + protected Predicate defineUnsupportedOperatingSystems() { + return new Predicate() { + + @Override + public boolean apply(OsFamilyVersion64Bit input) { + return (input.family != OsFamily.WINDOWS && !input.is64Bit) || // + input.family == OsFamily.RHEL || // + (input.family == OsFamily.UBUNTU && input.version.equals("11.04")) || // + (input.family == OsFamily.CENTOS && input.version.matches("5.[23]")) || // + (input.family == OsFamily.WINDOWS && input.version.equals("2008")) || // + (input.family == OsFamily.WINDOWS && input.version.equals("2008 R2") && !input.is64Bit); + } + + }; + } + + @Test + public void testTemplateBuilder() { + Template defaultTemplate = this.context.getComputeService().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(), "US"); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + } +} diff --git a/providers/pom.xml b/providers/pom.xml index 5e61145e31..451536ca53 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -43,5 +43,9 @@ scaleup-storage ecc-s3 ecc-ec2 + cloudservers-us + cloudservers-uk + cloudfiles-us + cloudfiles-uk