Skip to content

Commit

Permalink
Issue 550: added rackspace provider metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Cole committed May 30, 2011
1 parent 319235a commit 009479c
Show file tree
Hide file tree
Showing 15 changed files with 758 additions and 0 deletions.
@@ -0,0 +1,116 @@
/**
*
* Copyright (C) 2011 Cloud Consciouk, LLC. <info@cloudconsciouk.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not uke 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 com.google.common.collect.ImmutableSet;

import java.net.URI;
import java.util.Set;

import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;

/**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files in UK.
*
* @author Adrian Cole
*/
public class CloudFilesUKProviderMetadata extends BaseProviderMetadata {

/**
* {@inheritDoc}
*/
@Override
public String getId() {
return "cloudfiles-uk";
}

/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.BLOBSTORE_TYPE;
}

/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Rackspace Cloud Files UK";
}

/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}

/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}

/**
* {@inheritDoc}
*/
@Override
public URI getHomepage() {
return URI.create("http://www.rackspace.co.uk/cloud-hosting/cloud-products/cloud-files");
}

/**
* {@inheritDoc}
*/
@Override
public URI getConsole() {
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}
*/
@Override
public Set<String> getLinkedServices() {
return ImmutableSet.of("cloudfiles-uk", "cloudservers-uk");
}

/**
* {@inheritDoc}
*/
@Override
public Set<String> getIso3166Codes() {
return ImmutableSet.of("GB-SLG");
}

}
@@ -0,0 +1 @@
org.jclouds.rackspace.cloudfiles.CloudFilesUKProviderMetadata
@@ -0,0 +1,35 @@
/**
*
* Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.providers.BaseProviderMetadataTest;
import org.jclouds.providers.ProviderMetadata;
import org.testng.annotations.Test;

/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudFilesUKProviderTest")
public class CloudFilesUKProviderTest extends BaseProviderMetadataTest {

public CloudFilesUKProviderTest() {
super(new CloudFilesUKProviderMetadata(), ProviderMetadata.BLOBSTORE_TYPE);
}
}
@@ -0,0 +1,116 @@
/**
*
* Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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 com.google.common.collect.ImmutableSet;

import java.net.URI;
import java.util.Set;

import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;

/**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files in US.
*
* @author Adrian Cole
*/
public class CloudFilesUSProviderMetadata extends BaseProviderMetadata {

/**
* {@inheritDoc}
*/
@Override
public String getId() {
return "cloudfiles-us";
}

/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.BLOBSTORE_TYPE;
}

/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Rackspace Cloud Files US";
}

/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}

/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}

/**
* {@inheritDoc}
*/
@Override
public URI getHomepage() {
return URI.create("http://www.rackspace.com/cloud/cloud_hosting_products/files");
}

/**
* {@inheritDoc}
*/
@Override
public URI getConsole() {
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}
*/
@Override
public Set<String> getLinkedServices() {
return ImmutableSet.of("cloudfiles-us", "cloudservers-us", "cloudloadbalancers-us");
}

/**
* {@inheritDoc}
*/
@Override
public Set<String> getIso3166Codes() {
return ImmutableSet.of("US-IL","US-TX");
}

}
@@ -0,0 +1 @@
org.jclouds.rackspace.cloudfiles.CloudFilesUSProviderMetadata
@@ -0,0 +1,35 @@
/**
*
* Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* 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.providers.BaseProviderMetadataTest;
import org.jclouds.providers.ProviderMetadata;
import org.testng.annotations.Test;

/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudFilesUSProviderTest")
public class CloudFilesUSProviderTest extends BaseProviderMetadataTest {

public CloudFilesUSProviderTest() {
super(new CloudFilesUSProviderMetadata(), ProviderMetadata.BLOBSTORE_TYPE);
}
}

0 comments on commit 009479c

Please sign in to comment.