Merge pull request #132 from danikov/master

Issue 551: support rackspace cloud load balancers
This commit is contained in:
Adrian Cole 2011-11-11 00:46:15 -08:00
commit 738fbbd331
74 changed files with 1002 additions and 217 deletions

View File

@ -0,0 +1,41 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudfiles;
import java.util.Properties;
import org.jclouds.openstack.swift.SwiftPropertiesBuilder;
/**
*
* @author Adrian Cole
*/
public class CloudFilesPropertiesBuilder extends SwiftPropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
return properties;
}
public CloudFilesPropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,69 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudfiles;
import java.net.URI;
import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/**
* Common implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files
*
* @author Dan Lo Bianco
*/
public abstract class CloudFilesProviderMetadata extends BaseProviderMetadata {
public CloudFilesProviderMetadata() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.BLOBSTORE_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/files/api/v1/cfdevguide_d5/content/ch01.html");
}
}

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to jclouds, Inc. (jclouds) under one or more
contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. jclouds licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.api</groupId>
<artifactId>cloudloadbalancers</artifactId>
<name>jclouds cloudloadbalancers api</name>
<description>jclouds components to access a rackspace implementation of LoadBalancer</description>
<packaging>bundle</packaging>
<properties>
<test.cloudloadbalancers.endpoint>https://auth.api.rackspacecloud.com</test.cloudloadbalancers.endpoint>
<test.cloudloadbalancers.apiversion>1.0</test.cloudloadbalancers.apiversion>
<test.cloudloadbalancers.identity>${test.rackspace.identity}</test.cloudloadbalancers.identity>
<test.cloudloadbalancers.credential>${test.rackspace.credential}</test.cloudloadbalancers.credential>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-loadbalancer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.common</groupId>
<artifactId>openstack-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-loadbalancer</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.common</groupId>
<artifactId>openstack-common</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>test.cloudloadbalancers.endpoint</name>
<value>${test.cloudloadbalancers.endpoint}</value>
</property>
<property>
<name>test.cloudloadbalancers.apiversion</name>
<value>${test.cloudloadbalancers.apiversion}</value>
</property>
<property>
<name>test.cloudloadbalancers.identity</name>
<value>${test.cloudloadbalancers.identity}</value>
</property>
<property>
<name>test.cloudloadbalancers.credential</name>
<value>${test.cloudloadbalancers.credential}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Export-Package>org.jclouds.cloudloadbalancers.*;version="${project.version}"</Export-Package>
<Import-Package>org.jclouds.*;version="${project.version}",*</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,45 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import java.util.Properties;
import org.jclouds.PropertiesBuilder;
/**
* Builds properties used inRackspace Cloud Load Balancers Clients
*
* @author Dan Lo Bianco
*/
public class CloudLoadBalancersPropertiesBuilder extends PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_API_VERSION, "1.0");
return properties;
}
public CloudLoadBalancersPropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,69 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import java.net.URI;
import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/**
* Common implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud LoadBalancers.
*
* @author Dan Lo Bianco
*/
public abstract class CloudLoadBalancersProviderMetadata extends BaseProviderMetadata {
public CloudLoadBalancersProviderMetadata() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.LOADBALANCER_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/loadbalancers/api/v1.0/clb-devguide/content/ch01.html");
}
}

View File

@ -50,4 +50,9 @@ public interface Region {
*/ */
public final static String DFW = "DFW"; public final static String DFW = "DFW";
/**
* London/Slough (LON) https://lon.loadbalancers.api.rackspacecloud.com/v1.0/1234/
*/
public final static String LON = "LON";
} }

View File

@ -18,11 +18,17 @@
*/ */
package org.jclouds.cloudloadbalancers; package org.jclouds.cloudloadbalancers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.io.IOException; import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import org.jclouds.cloudloadbalancers.features.BaseCloudLoadBalancersAsyncClientTest; import org.jclouds.cloudloadbalancers.features.BaseCloudLoadBalancersAsyncClientTest;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.rest.RestContextFactory;
import org.jclouds.rest.RestContextSpec;
import org.jclouds.rest.internal.RestAnnotationProcessor; import org.jclouds.rest.internal.RestAnnotationProcessor;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -67,4 +73,21 @@ public class CloudLoadBalancersAsyncClientTest extends BaseCloudLoadBalancersAsy
protected void checkFilters(HttpRequest request) { protected void checkFilters(HttpRequest request) {
} }
protected String provider = "cloudloadbalancers";
@Override
public RestContextSpec<CloudLoadBalancersClient, CloudLoadBalancersAsyncClient> createContextSpec() {
return new RestContextFactory(getProperties()).createContextSpec(provider, "user", "password", new Properties());
}
@Override
protected Properties getProperties() {
Properties overrides = new Properties();
overrides.setProperty(PROPERTY_REGIONS, "US");
overrides.setProperty(PROPERTY_API_VERSION, "1");
overrides.setProperty(provider + ".endpoint", "https://auth");
overrides.setProperty(provider + ".contextbuilder", CloudLoadBalancersContextBuilder.class.getName());
return overrides;
}
} }

View File

@ -86,7 +86,7 @@ public abstract class BaseCloudLoadBalancersAsyncClientTest<T> extends RestClien
@Override @Override
public RestContextSpec<CloudLoadBalancersClient, CloudLoadBalancersAsyncClient> createContextSpec() { public RestContextSpec<CloudLoadBalancersClient, CloudLoadBalancersAsyncClient> createContextSpec() {
Properties props = new Properties(); Properties props = new Properties();
return new RestContextFactory().createContextSpec("cloudloadbalancers-us", "email", "apikey", props); return new RestContextFactory().createContextSpec("cloudloadbalancers", "email", "apikey", props);
} }
@BeforeClass @BeforeClass

View File

@ -52,7 +52,7 @@ public class BaseCloudLoadBalancersClientLiveTest {
protected CloudLoadBalancersClient client; protected CloudLoadBalancersClient client;
protected RestContext<CloudLoadBalancersClient, CloudLoadBalancersAsyncClient> context; protected RestContext<CloudLoadBalancersClient, CloudLoadBalancersAsyncClient> context;
protected String provider = "cloudloadbalancers-us"; protected String provider = "cloudloadbalancers";
protected String identity; protected String identity;
protected String credential; protected String credential;
protected String endpoint; protected String endpoint;

View File

@ -18,9 +18,16 @@
*/ */
package org.jclouds.cloudloadbalancers.features; package org.jclouds.cloudloadbalancers.features;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Properties;
import org.jclouds.cloudloadbalancers.CloudLoadBalancersAsyncClient;
import org.jclouds.cloudloadbalancers.CloudLoadBalancersClient;
import org.jclouds.cloudloadbalancers.CloudLoadBalancersContextBuilder;
import org.jclouds.cloudloadbalancers.domain.LoadBalancerAttributes; import org.jclouds.cloudloadbalancers.domain.LoadBalancerAttributes;
import org.jclouds.cloudloadbalancers.domain.LoadBalancerRequest; import org.jclouds.cloudloadbalancers.domain.LoadBalancerRequest;
import org.jclouds.cloudloadbalancers.domain.LoadBalancerAttributes.Builder; import org.jclouds.cloudloadbalancers.domain.LoadBalancerAttributes.Builder;
@ -29,6 +36,8 @@ import org.jclouds.cloudloadbalancers.functions.UnwrapLoadBalancer;
import org.jclouds.cloudloadbalancers.functions.UnwrapLoadBalancers; import org.jclouds.cloudloadbalancers.functions.UnwrapLoadBalancers;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.http.functions.ReleasePayloadAndReturn;
import org.jclouds.rest.RestContextFactory;
import org.jclouds.rest.RestContextSpec;
import org.jclouds.rest.functions.MapHttp4xxCodesToExceptions; import org.jclouds.rest.functions.MapHttp4xxCodesToExceptions;
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404; import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404; import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
@ -163,4 +172,21 @@ public class LoadBalancerAsyncClientTest extends BaseCloudLoadBalancersAsyncClie
return new TypeLiteral<RestAnnotationProcessor<LoadBalancerAsyncClient>>() { return new TypeLiteral<RestAnnotationProcessor<LoadBalancerAsyncClient>>() {
}; };
} }
protected String provider = "cloudloadbalancers";
@Override
public RestContextSpec<CloudLoadBalancersClient, CloudLoadBalancersAsyncClient> createContextSpec() {
return new RestContextFactory(getProperties()).createContextSpec(provider, "user", "password", new Properties());
}
@Override
protected Properties getProperties() {
Properties overrides = new Properties();
overrides.setProperty(PROPERTY_REGIONS, "US");
overrides.setProperty(PROPERTY_API_VERSION, "1");
overrides.setProperty(provider + ".endpoint", "https://auth");
overrides.setProperty(provider + ".contextbuilder", CloudLoadBalancersContextBuilder.class.getName());
return overrides;
}
} }

View File

@ -0,0 +1,45 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudservers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import java.util.Properties;
import org.jclouds.PropertiesBuilder;
import org.jclouds.openstack.OpenStackAuthAsyncClient;
/**
*
* @author Dan Lo Bianco
*/
public class CloudServersPropertiesBuilder extends PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_API_VERSION, OpenStackAuthAsyncClient.VERSION);
return properties;
}
public CloudServersPropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,69 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudservers;
import java.net.URI;
import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/**
* Common implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers.
*
* @author Dan Lo Bianco
*/
public abstract class CloudServersProviderMetadata extends BaseProviderMetadata {
public CloudServersProviderMetadata() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.COMPUTE_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide/content/ch01.html");
}
}

View File

@ -74,6 +74,9 @@ eucalyptus-partnercloud-ec2.propertiesbuilder=org.jclouds.epc.EucalyptusPartnerC
nova.contextbuilder=org.jclouds.openstack.nova.NovaContextBuilder nova.contextbuilder=org.jclouds.openstack.nova.NovaContextBuilder
nova.propertiesbuilder=org.jclouds.openstack.nova.NovaPropertiesBuilder nova.propertiesbuilder=org.jclouds.openstack.nova.NovaPropertiesBuilder
cloudservers.contextbuilder=org.jclouds.cloudservers.CloudServersContextBuilder
cloudservers.propertiesbuilder=org.jclouds.cloudservers.CloudServersPropertiesBuilder
cloudservers-uk.contextbuilder=org.jclouds.cloudservers.CloudServersContextBuilder cloudservers-uk.contextbuilder=org.jclouds.cloudservers.CloudServersContextBuilder
cloudservers-uk.propertiesbuilder=org.jclouds.rackspace.cloudservers.CloudServersUKPropertiesBuilder cloudservers-uk.propertiesbuilder=org.jclouds.rackspace.cloudservers.CloudServersUKPropertiesBuilder
@ -169,8 +172,17 @@ softlayer.propertiesbuilder=org.jclouds.softlayer.SoftLayerPropertiesBuilder
savvis-symphonyvpdc.contextbuilder=org.jclouds.savvis.vpdc.VPDCContextBuilder savvis-symphonyvpdc.contextbuilder=org.jclouds.savvis.vpdc.VPDCContextBuilder
savvis-symphonyvpdc.propertiesbuilder=org.jclouds.savvis.vpdc.VPDCPropertiesBuilder savvis-symphonyvpdc.propertiesbuilder=org.jclouds.savvis.vpdc.VPDCPropertiesBuilder
cloudloadbalancers.contextbuilder=org.jclouds.cloudloadbalancers.CloudLoadBalancersContextBuilder
cloudloadbalancers.propertiesbuilder=org.jclouds.cloudloadbalancers.CloudLoadBalancersPropertiesBuilder
cloudloadbalancers-us.contextbuilder=org.jclouds.cloudloadbalancers.CloudLoadBalancersContextBuilder cloudloadbalancers-us.contextbuilder=org.jclouds.cloudloadbalancers.CloudLoadBalancersContextBuilder
cloudloadbalancers-us.propertiesbuilder=org.jclouds.cloudloadbalancers.CloudLoadBalancersUSPropertiesBuilder cloudloadbalancers-us.propertiesbuilder=org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersUSPropertiesBuilder
cloudloadbalancers-uk.contextbuilder=org.jclouds.cloudloadbalancers.CloudLoadBalancersContextBuilder
cloudloadbalancers-uk.propertiesbuilder=org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersUKPropertiesBuilder
cloudfiles.contextbuilder=org.jclouds.cloudfiles.CloudFilesContextBuilder
cloudfiles.propertiesbuilder=org.jclouds.cloudfiles.CloudFilesPropertiesBuilder
cloudfiles-us.contextbuilder=org.jclouds.cloudfiles.CloudFilesContextBuilder cloudfiles-us.contextbuilder=org.jclouds.cloudfiles.CloudFilesContextBuilder
cloudfiles-us.propertiesbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesUSPropertiesBuilder cloudfiles-us.propertiesbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesUSPropertiesBuilder

View File

@ -24,13 +24,13 @@ import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties; import java.util.Properties;
import org.jclouds.openstack.swift.SwiftPropertiesBuilder; import org.jclouds.cloudfiles.CloudFilesPropertiesBuilder;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudFilesUKPropertiesBuilder extends SwiftPropertiesBuilder { public class CloudFilesUKPropertiesBuilder extends CloudFilesPropertiesBuilder {
@Override @Override
protected Properties defaultProperties() { protected Properties defaultProperties() {

View File

@ -18,20 +18,19 @@
*/ */
package org.jclouds.rackspace.cloudfiles; package org.jclouds.rackspace.cloudfiles;
import com.google.common.collect.ImmutableSet;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import org.jclouds.providers.BaseProviderMetadata; import org.jclouds.cloudfiles.CloudFilesProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
import com.google.common.collect.ImmutableSet;
/** /**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files in UK. * Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files in UK.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudFilesUKProviderMetadata extends BaseProviderMetadata { public class CloudFilesUKProviderMetadata extends CloudFilesProviderMetadata {
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -41,14 +40,6 @@ public class CloudFilesUKProviderMetadata extends BaseProviderMetadata {
return "cloudfiles-uk"; return "cloudfiles-uk";
} }
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.BLOBSTORE_TYPE;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -57,22 +48,6 @@ public class CloudFilesUKProviderMetadata extends BaseProviderMetadata {
return "Rackspace Cloud Files UK"; return "Rackspace Cloud Files UK";
} }
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -89,20 +64,12 @@ public class CloudFilesUKProviderMetadata extends BaseProviderMetadata {
return URI.create("https://lon.manage.rackspacecloud.com"); return URI.create("https://lon.manage.rackspacecloud.com");
} }
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/files/api/v1/cfdevguide_d5/content/ch01.html");
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Set<String> getLinkedServices() { public Set<String> getLinkedServices() {
return ImmutableSet.of("cloudfiles-uk", "cloudservers-uk"); return ImmutableSet.of("cloudfiles-uk", "cloudservers-uk", "cloudloadbalancers-uk");
} }
/** /**

View File

@ -24,13 +24,13 @@ import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties; import java.util.Properties;
import org.jclouds.openstack.swift.SwiftPropertiesBuilder; import org.jclouds.cloudfiles.CloudFilesPropertiesBuilder;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudFilesUSPropertiesBuilder extends SwiftPropertiesBuilder { public class CloudFilesUSPropertiesBuilder extends CloudFilesPropertiesBuilder {
@Override @Override
protected Properties defaultProperties() { protected Properties defaultProperties() {

View File

@ -23,15 +23,15 @@ import com.google.common.collect.ImmutableSet;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import org.jclouds.providers.BaseProviderMetadata; import org.jclouds.cloudfiles.CloudFilesProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/** /**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files in US. * Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files in US.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudFilesUSProviderMetadata extends BaseProviderMetadata { public class CloudFilesUSProviderMetadata extends CloudFilesProviderMetadata {
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -41,14 +41,6 @@ public class CloudFilesUSProviderMetadata extends BaseProviderMetadata {
return "cloudfiles-us"; return "cloudfiles-us";
} }
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.BLOBSTORE_TYPE;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -57,22 +49,6 @@ public class CloudFilesUSProviderMetadata extends BaseProviderMetadata {
return "Rackspace Cloud Files US"; return "Rackspace Cloud Files US";
} }
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -89,14 +65,6 @@ public class CloudFilesUSProviderMetadata extends BaseProviderMetadata {
return URI.create("https://manage.rackspacecloud.com"); return URI.create("https://manage.rackspacecloud.com");
} }
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/files/api/v1/cfdevguide_d5/content/ch01.html");
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to jclouds, Inc. (jclouds) under one or more
contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. jclouds licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.provider</groupId>
<artifactId>cloudloadbalancers-uk</artifactId>
<name>jclouds CloudLoadBalancers UK provider </name>
<description>LoadBalancer implementation targeted to Rackspace UK</description>
<packaging>bundle</packaging>
<properties>
<test.cloudloadbalancers-uk.endpoint>https://lon.auth.api.rackspacecloud.com</test.cloudloadbalancers-uk.endpoint>
<test.cloudloadbalancers-uk.apiversion>1.0</test.cloudloadbalancers-uk.apiversion>
<test.cloudloadbalancers-uk.identity>${test.rackspace-uk.identity}</test.cloudloadbalancers-uk.identity>
<test.cloudloadbalancers-uk.credential>${test.rackspace-uk.credential}</test.cloudloadbalancers-uk.credential>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>cloudloadbalancers</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>cloudloadbalancers</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-loadbalancer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.common</groupId>
<artifactId>openstack-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-loadbalancer</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.common</groupId>
<artifactId>openstack-common</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>test.cloudloadbalancers-uk.endpoint</name>
<value>${test.cloudloadbalancers-uk.endpoint}</value>
</property>
<property>
<name>test.cloudloadbalancers-uk.apiversion</name>
<value>${test.cloudloadbalancers-uk.apiversion}</value>
</property>
<property>
<name>test.cloudloadbalancers-uk.identity</name>
<value>${test.cloudloadbalancers-uk.identity}</value>
</property>
<property>
<name>test.cloudloadbalancers-uk.credential</name>
<value>${test.cloudloadbalancers-uk.credential}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Export-Package>org.jclouds.rackspace.cloudloadbalancers.*;version="${project.version}"</Export-Package>
<Import-Package>org.jclouds.*;version="${project.version}",*</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,60 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import static org.jclouds.cloudloadbalancers.reference.RackspaceConstants.PROPERTY_ACCOUNT_ID;
import static org.jclouds.cloudloadbalancers.reference.Region.LON;
import static org.jclouds.location.reference.LocationConstants.ENDPOINT;
import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties;
import org.jclouds.cloudloadbalancers.CloudLoadBalancersPropertiesBuilder;
/**
* Builds properties used inRackspace Cloud Load Balancers Clients
*
* @author Dan Lo Bianco
*/
public class CloudLoadBalancersUKPropertiesBuilder extends CloudLoadBalancersPropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_REGIONS, "UK");
properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_ISO3166_CODES, "GB-SLG");
properties.setProperty(PROPERTY_REGION + "." + LON + "." + ISO3166_CODES, "GB-SLG");
properties.setProperty(PROPERTY_REGION + "." + LON + "." + ENDPOINT, String
.format("https://lon.loadbalancers.api.rackspacecloud.com/v{%s}/{%s}", PROPERTY_API_VERSION,
PROPERTY_ACCOUNT_ID));
return properties;
}
public CloudLoadBalancersUKPropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,83 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import java.net.URI;
import java.util.Set;
import org.jclouds.cloudloadbalancers.CloudLoadBalancersProviderMetadata;
import com.google.common.collect.ImmutableSet;
/**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud LoadBalancers in UK.
*
* @author Dan Lo Bianco
*/
public class CloudLoadBalancersUKProviderMetadata extends CloudLoadBalancersProviderMetadata {
/**
* {@inheritDoc}
*/
@Override
public String getId() {
return "cloudloadbalancers-uk";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Rackspace Cloud Load Balancers UK";
}
/**
* {@inheritDoc}
*/
@Override
public URI getHomepage() {
return URI.create("http://www.rackspace.co.uk/cloud-hosting/cloud-products/cloud-load-balancers/");
}
/**
* {@inheritDoc}
*/
@Override
public URI getConsole() {
return URI.create("https://lon.manage.rackspacecloud.com");
}
/**
* {@inheritDoc}
*/
@Override
public Set<String> getLinkedServices() {
return ImmutableSet.of("cloudfiles-uk", "cloudservers-uk", "cloudloadbalancers-uk");
}
/**
* {@inheritDoc}
*/
@Override
public Set<String> getIso3166Codes() {
return ImmutableSet.of("GB-SLG");
}
}

View File

@ -0,0 +1 @@
org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersUKProviderMetadata

View File

@ -0,0 +1,33 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import org.jclouds.cloudloadbalancers.features.LoadBalancerClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Dan Lo Bianco
*/
@Test(groups = "live", singleThreaded = true)
public class CloudLoadBalancersUKClientLiveTest extends LoadBalancerClientLiveTest {
public CloudLoadBalancersUKClientLiveTest() {
provider = "cloudloadbalancers-uk";
}
}

View File

@ -0,0 +1,36 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import org.jclouds.providers.BaseProviderMetadataTest;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersUKProviderMetadata;
import org.testng.annotations.Test;
/**
*
* @author Dan Lo Bianco
*/
@Test(groups = "unit", testName = "CloudLoadBalancersUKProviderTest")
public class CloudLoadBalancersUKProviderTest extends BaseProviderMetadataTest {
public CloudLoadBalancersUKProviderTest() {
super(new CloudLoadBalancersUKProviderMetadata(), ProviderMetadata.LOADBALANCER_TYPE);
}
}

View File

@ -29,8 +29,8 @@
</parent> </parent>
<groupId>org.jclouds.provider</groupId> <groupId>org.jclouds.provider</groupId>
<artifactId>cloudloadbalancers-us</artifactId> <artifactId>cloudloadbalancers-us</artifactId>
<name>jclouds cloudloadbalancers-us core</name> <name>jclouds CloudLoadBalancers US provider </name>
<description>jclouds components to access cloudloadbalancers-us</description> <description>LoadBalancer implementation targeted to Rackspace US</description>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<properties> <properties>
@ -39,7 +39,20 @@
<test.cloudloadbalancers-us.identity>${test.rackspace-us.identity}</test.cloudloadbalancers-us.identity> <test.cloudloadbalancers-us.identity>${test.rackspace-us.identity}</test.cloudloadbalancers-us.identity>
<test.cloudloadbalancers-us.credential>${test.rackspace-us.credential}</test.cloudloadbalancers-us.credential> <test.cloudloadbalancers-us.credential>${test.rackspace-us.credential}</test.cloudloadbalancers-us.credential>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>cloudloadbalancers</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>cloudloadbalancers</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-loadbalancer</artifactId> <artifactId>jclouds-loadbalancer</artifactId>

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.jclouds.cloudloadbalancers; package org.jclouds.rackspace.cloudloadbalancers;
import static org.jclouds.Constants.PROPERTY_API_VERSION; import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_ENDPOINT;
@ -31,7 +31,7 @@ import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties; import java.util.Properties;
import org.jclouds.PropertiesBuilder; import org.jclouds.cloudloadbalancers.CloudLoadBalancersPropertiesBuilder;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
@ -40,11 +40,10 @@ import com.google.common.base.Joiner;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudLoadBalancersUSPropertiesBuilder extends PropertiesBuilder { public class CloudLoadBalancersUSPropertiesBuilder extends CloudLoadBalancersPropertiesBuilder {
@Override @Override
protected Properties defaultProperties() { protected Properties defaultProperties() {
Properties properties = super.defaultProperties(); Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_API_VERSION, "1.0");
properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com"); properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(ORD, DFW)); properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(ORD, DFW));
properties.setProperty(PROPERTY_ISO3166_CODES, "US-IL,US-TX"); properties.setProperty(PROPERTY_ISO3166_CODES, "US-IL,US-TX");

View File

@ -16,22 +16,21 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.jclouds.cloudloadbalancers; package org.jclouds.rackspace.cloudloadbalancers;
import com.google.common.collect.ImmutableSet;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import org.jclouds.providers.BaseProviderMetadata; import org.jclouds.cloudloadbalancers.CloudLoadBalancersProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
import com.google.common.collect.ImmutableSet;
/** /**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud LoadBalancers in US. * Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud LoadBalancers in US.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudLoadBalancersUSProviderMetadata extends BaseProviderMetadata { public class CloudLoadBalancersUSProviderMetadata extends CloudLoadBalancersProviderMetadata {
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -41,14 +40,6 @@ public class CloudLoadBalancersUSProviderMetadata extends BaseProviderMetadata {
return "cloudloadbalancers-us"; return "cloudloadbalancers-us";
} }
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.LOADBALANCER_TYPE;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -58,28 +49,12 @@ public class CloudLoadBalancersUSProviderMetadata extends BaseProviderMetadata {
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public String getIdentityName() { public URI getHomepage() {
return "Username"; return URI.create("http://www.rackspace.com/cloud/cloud_hosting_products/loadbalancers");
} }
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getHomepage() {
return URI.create("http://www.rackspace.com/cloud/cloud_hosting_products/loadbalancers");
}
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -89,14 +64,6 @@ public class CloudLoadBalancersUSProviderMetadata extends BaseProviderMetadata {
return URI.create("https://manage.rackspacecloud.com"); return URI.create("https://manage.rackspacecloud.com");
} }
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/loadbalancers/api/v1.0/clb-devguide/content/ch01.html");
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -1 +1 @@
org.jclouds.cloudloadbalancers.CloudLoadBalancersUSProviderMetadata org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersUSProviderMetadata

View File

@ -0,0 +1,33 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.cloudloadbalancers;
import org.jclouds.cloudloadbalancers.features.LoadBalancerClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Dan Lo Bianco
*/
@Test(groups = "live", singleThreaded = true)
public class CloudLoadBalancersUSClientLiveTest extends LoadBalancerClientLiveTest {
public CloudLoadBalancersUSClientLiveTest() {
provider = "cloudloadbalancers-us";
}
}

View File

@ -16,10 +16,11 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.jclouds.cloudloadbalancers; package org.jclouds.rackspace.cloudloadbalancers;
import org.jclouds.providers.BaseProviderMetadataTest; import org.jclouds.providers.BaseProviderMetadataTest;
import org.jclouds.providers.ProviderMetadata; import org.jclouds.providers.ProviderMetadata;
import org.jclouds.rackspace.cloudloadbalancers.CloudLoadBalancersUSProviderMetadata;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**

View File

@ -18,27 +18,24 @@
*/ */
package org.jclouds.rackspace.cloudservers; package org.jclouds.rackspace.cloudservers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import java.util.Properties; import java.util.Properties;
import org.jclouds.PropertiesBuilder; import org.jclouds.cloudservers.CloudServersPropertiesBuilder;
import org.jclouds.openstack.OpenStackAuthAsyncClient;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudServersUKPropertiesBuilder extends PropertiesBuilder { public class CloudServersUKPropertiesBuilder extends CloudServersPropertiesBuilder {
@Override @Override
protected Properties defaultProperties() { protected Properties defaultProperties() {
Properties properties = super.defaultProperties(); Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_ISO3166_CODES, "GB-SLG"); properties.setProperty(PROPERTY_ISO3166_CODES, "GB-SLG");
properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com"); properties.setProperty(PROPERTY_ENDPOINT, "https://lon.auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_API_VERSION, OpenStackAuthAsyncClient.VERSION);
return properties; return properties;
} }

View File

@ -18,20 +18,19 @@
*/ */
package org.jclouds.rackspace.cloudservers; package org.jclouds.rackspace.cloudservers;
import com.google.common.collect.ImmutableSet;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import org.jclouds.providers.BaseProviderMetadata; import org.jclouds.cloudservers.CloudServersProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
import com.google.common.collect.ImmutableSet;
/** /**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers. * Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers in UK.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudServersUKProviderMetadata extends BaseProviderMetadata { public class CloudServersUKProviderMetadata extends CloudServersProviderMetadata {
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -41,14 +40,6 @@ public class CloudServersUKProviderMetadata extends BaseProviderMetadata {
return "cloudservers-uk"; return "cloudservers-uk";
} }
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.COMPUTE_TYPE;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -57,22 +48,6 @@ public class CloudServersUKProviderMetadata extends BaseProviderMetadata {
return "Rackspace Cloud Servers UK"; return "Rackspace Cloud Servers UK";
} }
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -89,20 +64,12 @@ public class CloudServersUKProviderMetadata extends BaseProviderMetadata {
return URI.create("https://lon.manage.rackspacecloud.com"); return URI.create("https://lon.manage.rackspacecloud.com");
} }
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide/content/ch01.html");
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Set<String> getLinkedServices() { public Set<String> getLinkedServices() {
return ImmutableSet.of("cloudfiles-uk", "cloudservers-uk"); return ImmutableSet.of("cloudfiles-uk", "cloudservers-uk", "cloudloadbalancers-uk");
} }
/** /**

View File

@ -18,27 +18,24 @@
*/ */
package org.jclouds.rackspace.cloudservers; package org.jclouds.rackspace.cloudservers;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import java.util.Properties; import java.util.Properties;
import org.jclouds.PropertiesBuilder; import org.jclouds.cloudservers.CloudServersPropertiesBuilder;
import org.jclouds.openstack.OpenStackAuthAsyncClient;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudServersUSPropertiesBuilder extends PropertiesBuilder { public class CloudServersUSPropertiesBuilder extends CloudServersPropertiesBuilder {
@Override @Override
protected Properties defaultProperties() { protected Properties defaultProperties() {
Properties properties = super.defaultProperties(); Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_ISO3166_CODES, "US-IL,US-TX"); properties.setProperty(PROPERTY_ISO3166_CODES, "US-IL,US-TX");
properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com"); properties.setProperty(PROPERTY_ENDPOINT, "https://auth.api.rackspacecloud.com");
properties.setProperty(PROPERTY_API_VERSION, OpenStackAuthAsyncClient.VERSION);
return properties; return properties;
} }

View File

@ -23,15 +23,15 @@ import com.google.common.collect.ImmutableSet;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import org.jclouds.providers.BaseProviderMetadata; import org.jclouds.cloudservers.CloudServersProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/** /**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers in US. * Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers in US.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
public class CloudServersUSProviderMetadata extends BaseProviderMetadata { public class CloudServersUSProviderMetadata extends CloudServersProviderMetadata {
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -41,14 +41,6 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
return "cloudservers-us"; return "cloudservers-us";
} }
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.COMPUTE_TYPE;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -57,22 +49,6 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
return "Rackspace Cloud Servers US"; return "Rackspace Cloud Servers US";
} }
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -89,14 +65,6 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
return URI.create("https://manage.rackspacecloud.com"); return URI.create("https://manage.rackspacecloud.com");
} }
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide/content/ch01.html");
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */