created new providers that run the elasticstack api:

org.jclouds.api/elasticstack
org.jclouds.provider/elastichosts-lon-b
org.jclouds.provider/elastichosts-lon-p
org.jclouds.provider/elastichosts-sat-p
org.jclouds.provider/openhosting-east1
org.jclouds.provider/serverlove-z1-man
org.jclouds.provider/skalicloud-sdg-my
This commit is contained in:
Adrian Cole 2011-01-09 22:24:41 -08:00
parent e71d412a0a
commit cfcee554b3
137 changed files with 2685 additions and 26 deletions

View File

@ -35,6 +35,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers (generic), cloudservers-
cloudsigma, elasticstack(generic), bluelock-vclouddirector,
slicehost, ecc-ec2, elastichosts-lon-p (Peer 1),
elastichosts-sat-p (Peer 1), elastichosts-lon-b (BlueSquare),
openhosting-east1, serverlove-z1-man, skalicloud-sdg-my,
vcloudexpress (generic), stub (in-memory)
* note * the pom dependency org.jclouds/jclouds-allcompute gives you access to

View File

@ -105,8 +105,38 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-elasticstack</artifactId>
<groupId>org.jclouds.api</groupId>
<artifactId>elasticstack</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>elastichosts-lon-p</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>elastichosts-sat-p</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>elastichosts-lon-b</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>openhosting-east1</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>serverlove-z1-man</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.provider</groupId>
<artifactId>skalicloud-sdg-my</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -28,10 +28,10 @@
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../project/pom.xml</relativePath>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-elasticstack</artifactId>
<groupId>org.jclouds.api</groupId>
<artifactId>elasticstack</artifactId>
<name>jclouds elasticstack core</name>
<description>jclouds components to access elasticstack</description>
@ -60,25 +60,25 @@
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-jsch</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
@ -91,7 +91,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>

View File

@ -39,10 +39,10 @@ import org.jclouds.elasticstack.ElasticStackAsyncClient;
import org.jclouds.elasticstack.ElasticStackClient;
import org.jclouds.elasticstack.compute.ElasticStackComputeServiceAdapter;
import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata;
import org.jclouds.elasticstack.compute.functions.WellKnownImageToImage;
import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata.DeviceToVolume;
import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata.FindImageForId;
import org.jclouds.elasticstack.compute.functions.ServerInfoToNodeMetadata.GetImageIdFromServer;
import org.jclouds.elasticstack.compute.functions.WellKnownImageToImage;
import org.jclouds.elasticstack.domain.Device;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.elasticstack.domain.Server;
@ -51,6 +51,7 @@ import org.jclouds.elasticstack.domain.WellKnownImage;
import org.jclouds.elasticstack.predicates.DriveClaimed;
import org.jclouds.functions.IdentityFunction;
import org.jclouds.json.Json;
import org.jclouds.location.Provider;
import org.jclouds.location.suppliers.OnlyLocationOrFirstZone;
import org.jclouds.predicates.RetryablePredicate;
import org.jclouds.util.Strings2;
@ -126,9 +127,9 @@ public class ElasticStackComputeServiceContextModule
@Singleton
@Provides
protected Map<String, WellKnownImage> provideImages(Json json) throws IOException {
protected Map<String, WellKnownImage> provideImages(Json json, @Provider String providerName) throws IOException {
List<WellKnownImage> wellKnowns = json.fromJson(
Strings2.toStringAndClose(getClass().getResourceAsStream("/preinstalled_images.json")),
Strings2.toStringAndClose(getClass().getResourceAsStream("/"+providerName+"/preinstalled_images.json")),
new TypeLiteral<List<WellKnownImage>>() {
}.getType());
return Maps.uniqueIndex(wellKnowns, new Function<WellKnownImage, String>() {

View File

@ -64,7 +64,7 @@ public class WellKnownImageToImage implements Function<DriveInfo, Image> {
.description(drive.getName())
.operatingSystem(
new OperatingSystemBuilder().family(input.getOsFamily()).version(input.getOsVersion())
.name(input.getDescription()).description(drive.getName()).is64Bit(true).build()).version("")
.name(input.getDescription()).description(drive.getName()).is64Bit(input.is64bit()).build()).version("")
.build();
}
}

View File

@ -33,6 +33,7 @@ public class WellKnownImage {
private OsFamily osFamily;
private String osVersion;
private int size;
private boolean is64bit = true;
// intended only for serialization
WellKnownImage() {
@ -61,9 +62,13 @@ public class WellKnownImage {
return size;
}
public boolean is64bit() {
return is64bit;
}
@Override
public int hashCode() {
return Objects.hashCode(uuid, description, osFamily, osVersion, size);
return Objects.hashCode(uuid, description, osFamily, osVersion, size, is64bit);
}
@Override
@ -76,7 +81,7 @@ public class WellKnownImage {
@Override
public String toString() {
return Objects.toStringHelper(this).add("uuid", uuid).add("description", description).add("osFamily", osFamily)
.add("osVersion", osVersion).add("size", size).toString();
.add("osVersion", osVersion).add("size", size).add("is64bit", is64bit).toString();
}
}

View File

@ -44,5 +44,6 @@
<module>cloudservers</module>
<module>vcloud</module>
<module>vcloudexpress</module>
<module>elasticstack</module>
</modules>
</project>

View File

@ -24,6 +24,7 @@ Current supported providers are:
[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,
openhosting-east1, serverlove-z1-man, skalicloud-sdg-my,
elastichosts-lon-b, cloudsigma, vcloudexpress, stub]
Here's an example of getting some compute configuration from rackspace:

View File

@ -119,20 +119,23 @@ elasticstack.propertiesbuilder=org.jclouds.elasticstack.ElasticStackPropertiesBu
elasticstack.contextbuilder=org.jclouds.elasticstack.ElasticStackContextBuilder
elasticstack.apiversion=1.0
elastichosts-lon-p.propertiesbuilder=org.jclouds.elasticstack.ElasticStackPropertiesBuilder
elastichosts-lon-p.propertiesbuilder=org.jclouds.elastichosts.ElasticHostsPeer1LondonPropertiesBuilder
elastichosts-lon-p.contextbuilder=org.jclouds.elasticstack.ElasticStackContextBuilder
elastichosts-lon-p.apiversion=1.0
elastichosts-lon-p.endpoint=https://api.lon-p.elastichosts.com
elastichosts-lon-b.propertiesbuilder=org.jclouds.elasticstack.ElasticStackPropertiesBuilder
elastichosts-lon-b.propertiesbuilder=org.jclouds.elastichosts.ElasticHostsBlueSquareLondonPropertiesBuilder
elastichosts-lon-b.contextbuilder=org.jclouds.elasticstack.ElasticStackContextBuilder
elastichosts-lon-b.apiversion=1.0
elastichosts-lon-b.endpoint=https://api.lon-b.elastichosts.com
elastichosts-sat-p.propertiesbuilder=org.jclouds.elasticstack.ElasticStackPropertiesBuilder
elastichosts-sat-p.propertiesbuilder=org.jclouds.elastichosts.ElasticHostsPeer1SanAntonioPropertiesBuilder
elastichosts-sat-p.contextbuilder=org.jclouds.elasticstack.ElasticStackContextBuilder
elastichosts-sat-p.apiversion=1.0
elastichosts-sat-p.endpoint=https://api.sat-p.elastichosts.com
skalicloud-sdg-my.propertiesbuilder=org.jclouds.skalicloud.SkaliCloudMalaysiaPropertiesBuilder
skalicloud-sdg-my.contextbuilder=org.jclouds.skalicloud.SkaliCloudMalaysiaContextBuilder
serverlove-z1-man.propertiesbuilder=org.jclouds.serverlove.ServerloveManchesterPropertiesBuilder
serverlove-z1-man.contextbuilder=org.jclouds.serverlove.ServerloveManchesterContextBuilder
openhosting-east1.propertiesbuilder=org.jclouds.openhosting.OpenHostingEast1PropertiesBuilder
openhosting-east1.contextbuilder=org.jclouds.openhosting.OpenHostingEast1ContextBuilder
cloudsigma.propertiesbuilder=org.jclouds.cloudsigma.CloudSigmaPropertiesBuilder
cloudsigma.contextbuilder=org.jclouds.cloudsigma.CloudSigmaContextBuilder

View File

@ -47,7 +47,6 @@
<module>scriptbuilder</module>
<module>azure</module>
<module>atmos</module>
<module>elasticstack</module>
<module>allcompute</module>
<module>allblobstore</module>
<module>all</module>

View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2010 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.
====================================================================
-->
<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.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.provider</groupId>
<artifactId>elastichosts-lon-b</artifactId>
<name>jclouds ElasticHosts BlueSquare London provider</name>
<description>ElasticHosts implementation targeted to BlueSquare London</description>
<properties>
<test.elastichosts-lon-b.endpoint>https://api.lon-b.elastichosts.com</test.elastichosts-lon-b.endpoint>
<test.elastichosts-lon-b.apiversion>1.0</test.elastichosts-lon-b.apiversion>
<test.elastichosts-lon-b.identity>FIXME_IDENTITY</test.elastichosts-lon-b.identity>
<test.elastichosts-lon-b.credential>FIXME_CREDENTIAL</test.elastichosts-lon-b.credential>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>elasticstack</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>elasticstack</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</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-compute</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-jsch</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</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.elastichosts-lon-b.endpoint</name>
<value>${test.elastichosts-lon-b.endpoint}</value>
</property>
<property>
<name>test.elastichosts-lon-b.apiversion</name>
<value>${test.elastichosts-lon-b.apiversion}</value>
</property>
<property>
<name>test.elastichosts-lon-b.identity</name>
<value>${test.elastichosts-lon-b.identity}</value>
</property>
<property>
<name>test.elastichosts-lon-b.credential</name>
<value>${test.elastichosts-lon-b.credential}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,47 @@
/**
*
* Copyright (C) 2010 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.elastichosts;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import java.util.Properties;
import org.jclouds.elasticstack.ElasticStackPropertiesBuilder;
/**
*
* @author Adrian Cole
*/
public class ElasticHostsBlueSquareLondonPropertiesBuilder extends ElasticStackPropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_ENDPOINT, "https://api.lon-p.elastichosts.com");
properties.setProperty(PROPERTY_API_VERSION, "1.0");
return properties;
}
public ElasticHostsBlueSquareLondonPropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,72 @@
[
{
"uuid": "38df0986-4d85-4b76-b502-3878ffc80161",
"description": "CentOS Linux 5.5",
"osFamily": "CENTOS",
"osVersion": "5.5",
"size": "3"
},
{
"uuid": "980cf63c-f21e-4382-997b-6541d5809629",
"description": "Debian Linux 5.0",
"osFamily": "DEBIAN",
"osVersion": "5.0",
"size": "1"
},
{
"uuid": "aee5589a-88c3-43ef-bb0a-9cab6e64192d",
"description": "Ubuntu Linux 10.04",
"osFamily": "UBUNTU",
"osVersion": "10.04",
"size": "1"
},
{
"uuid": "bf1d943e-2a55-46bb-a8c7-6099e44a3dde",
"description": "Ubuntu Linux 8.10: Base system with X",
"osFamily": "UBUNTU",
"osVersion": "8.10",
"size": "3"
},
{
"uuid": "757586d5-f1e9-4d9c-b215-5a391c9a24bf",
"description": "Ubuntu Linux 9.04: Base system with X",
"osFamily": "UBUNTU",
"osVersion": "9.04",
"size": "3"
},
{
"uuid": "b9d0eb72-d273-43f1-98e3-0d4b87d372c0",
"description": "Windows Web Server 2008",
"osFamily": "WINDOWS",
"osVersion": "2008",
"size": "13"
},
{
"uuid": "b405b598-4ae4-4ba8-8a2b-a9487d693f34",
"description": "Windows Web Server 2008 R2",
"osFamily": "WINDOWS",
"osVersion": "2008 R2",
"size": "13"
},
{
"uuid": "9397d327-3bf6-46a2-abf6-69553dbb6927",
"description": "Windows Web Server 2008 R2 + SQL Server",
"osFamily": "WINDOWS",
"osVersion": "2008 R2",
"size": "13"
},
{
"uuid": "10a88d1c-6575-46e3-8d2c-7744065ea530",
"description": "Windows Server 2008 Standard R2",
"osFamily": "WINDOWS",
"osVersion": "2008 R2",
"size": "13"
},
{
"uuid": "662c5b3f-9828-4aa2-a866-7cfa53798cdf",
"description": "Windows Server 2008 Standard R2 + SQL Server",
"osFamily": "WINDOWS",
"osVersion": "2008 R2",
"size": "13"
}
]

View File

@ -0,0 +1,34 @@
/**
*
* Copyright (C) 2010 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.elastichosts;
import org.jclouds.elasticstack.ElasticStackClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", sequential = true)
public class ElasticHostsBlueSquareLondonClientLiveTest extends ElasticStackClientLiveTest {
public ElasticHostsBlueSquareLondonClientLiveTest() {
provider = "elastichosts-lon-b";
}
}

View File

@ -0,0 +1,37 @@
/**
*
* Copyright (C) 2010 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.elastichosts.compute;
import org.jclouds.elasticstack.compute.ElasticStackComputeServiceLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", sequential = true, testName = "ElasticHostsBlueSquareLondonComputeServiceLiveTest")
public class ElasticHostsBlueSquareLondonComputeServiceLiveTest extends ElasticStackComputeServiceLiveTest {
public ElasticHostsBlueSquareLondonComputeServiceLiveTest() {
provider = "elastichosts-lon-b";
tag = "elastichosts";
}
}

View File

@ -0,0 +1,70 @@
/**
*
* Copyright (C) 2010 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.elastichosts.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 ElasticHostsBlueSquareLondonTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
public ElasticHostsBlueSquareLondonTemplateBuilderLiveTest() {
provider = "elastichosts-lon-b";
}
@Override
protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
return new Predicate<OsFamilyVersion64Bit>() {
@Override
public boolean apply(OsFamilyVersion64Bit input) {
return ((input.family == OsFamily.RHEL) || //
(input.family == OsFamily.CENTOS && !(input.version.equals("5.5") && input.is64Bit)) || //
(input.family == OsFamily.UBUNTU && !(input.version.equals("10.04") && input.is64Bit)) || //
(input.family == OsFamily.WINDOWS && !((input.version.equals("2008") || 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(), "elastichosts-lon-b");
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}
}

Some files were not shown because too many files have changed in this diff Show More