Issue 1056:create cloudstack-ec2 api

This commit is contained in:
Adrian Cole 2012-08-02 17:43:38 -07:00
parent b416496698
commit 486be5acc4
12 changed files with 487 additions and 0 deletions

129
labs/cloudstack-ec2/pom.xml Normal file
View File

@ -0,0 +1,129 @@
<?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.5.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.labs</groupId>
<artifactId>cloudstack-ec2</artifactId>
<name>jclouds CloudStack EC2 api</name>
<description>EC2 implementation based on CloudStack</description>
<packaging>bundle</packaging>
<properties>
<test.cloudstack-ec2.endpoint>http://localhost:8090/bridge/rest/AmazonEC2</test.cloudstack-ec2.endpoint>
<test.cloudstack-ec2.api-version>2010-11-15</test.cloudstack-ec2.api-version>
<test.cloudstack-ec2.build-version></test.cloudstack-ec2.build-version>
<test.cloudstack-ec2.identity>FIXME_IDENTITY</test.cloudstack-ec2.identity>
<test.cloudstack-ec2.credential>FIXME_CREDENTIAL</test.cloudstack-ec2.credential>
<test.cloudstack-ec2.template>imageId=fixme-region/ami-fixme</test.cloudstack-ec2.template>
<test.cloudstack-ec2.ebs-template>imageId=fixme-region/ami-fixmeebs</test.cloudstack-ec2.ebs-template>
<jclouds.osgi.export>org.jclouds.cloudstack.ec2*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.import>
org.jclouds.compute.internal;version="${project.version}",
org.jclouds.rest.internal;version="${project.version}",
org.jclouds*;version="${project.version}",
*
</jclouds.osgi.import>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>ec2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>ec2</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.driver</groupId>
<artifactId>jclouds-log4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-sshj</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>
<systemPropertyVariables>
<test.cloudstack-ec2.endpoint>${test.cloudstack-ec2.endpoint}</test.cloudstack-ec2.endpoint>
<test.cloudstack-ec2.api-version>${test.cloudstack-ec2.api-version}</test.cloudstack-ec2.api-version>
<test.cloudstack-ec2.build-version>${test.cloudstack-ec2.build-version}</test.cloudstack-ec2.build-version>
<test.cloudstack-ec2.identity>${test.cloudstack-ec2.identity}</test.cloudstack-ec2.identity>
<test.cloudstack-ec2.credential>${test.cloudstack-ec2.credential}</test.cloudstack-ec2.credential>
<test.cloudstack-ec2.template>${test.cloudstack-ec2.template}</test.cloudstack-ec2.template>
<test.cloudstack-ec2.ebs-template>${test.cloudstack-ec2.ebs-template}</test.cloudstack-ec2.ebs-template>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,84 @@
/**
* 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.cloudstack.ec2;
import java.net.URI;
import java.util.Properties;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.ec2.EC2ApiMetadata;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.EC2Client;
/**
* Implementation of {@link ApiMetadata} for the CloudStackEC2 (EC2 clone) api.
*
* @author Adrian Cole
*/
public class CloudStackEC2ApiMetadata extends EC2ApiMetadata {
/** The serialVersionUID */
private static final long serialVersionUID = 3060225665040763827L;
private static Builder builder() {
return new Builder();
}
@Override
public Builder toBuilder() {
return builder().fromApiMetadata(this);
}
public CloudStackEC2ApiMetadata() {
this(builder());
}
protected CloudStackEC2ApiMetadata(Builder builder) {
super(builder);
}
public static Properties defaultProperties() {
Properties properties = EC2ApiMetadata.defaultProperties();
return properties;
}
public static class Builder extends EC2ApiMetadata.Builder {
protected Builder() {
super(EC2Client.class, EC2AsyncClient.class);
id("cloudstack-ec2")
.name("CloudStackEC2 (EC2 clone) API")
.version("2010-11-15")
.defaultEndpoint("http://localhost:8090/bridge/rest/AmazonEC2")
.documentation(URI.create("http://docs.cloudstack.org/CloudBridge_Documentation"))
.defaultProperties(CloudStackEC2ApiMetadata.defaultProperties());
}
@Override
public CloudStackEC2ApiMetadata build() {
return new CloudStackEC2ApiMetadata(this);
}
@Override
public Builder fromApiMetadata(ApiMetadata in) {
super.fromApiMetadata(in);
return this;
}
}
}

View File

@ -0,0 +1 @@
org.jclouds.cloudstack.ec2.CloudStackEC2ApiMetadata

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2;
import org.jclouds.compute.internal.BaseComputeServiceApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudStackEC2ApiMetadataTest")
public class CloudStackEC2ApiMetadataTest extends BaseComputeServiceApiMetadataTest {
public CloudStackEC2ApiMetadataTest() {
super(new CloudStackEC2ApiMetadata());
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.AMIClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2AMIClientLiveTest")
public class CloudStackEC2AMIClientLiveTest extends AMIClientLiveTest {
public CloudStackEC2AMIClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.AvailabilityZoneAndRegionClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2AvailabilityZoneAndRegionClientLiveTest")
public class CloudStackEC2AvailabilityZoneAndRegionClientLiveTest extends AvailabilityZoneAndRegionClientLiveTest {
public CloudStackEC2AvailabilityZoneAndRegionClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.ElasticBlockStoreClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2ElasticBlockStoreClientLiveTest")
public class CloudStackEC2ElasticBlockStoreClientLiveTest extends ElasticBlockStoreClientLiveTest {
public CloudStackEC2ElasticBlockStoreClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.ElasticIPAddressClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2ElasticIPAddressClientLiveTest")
public class CloudStackEC2ElasticIPAddressClientLiveTest extends ElasticIPAddressClientLiveTest {
public CloudStackEC2ElasticIPAddressClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.InstanceClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2InstanceClientLiveTest")
public class CloudStackEC2InstanceClientLiveTest extends InstanceClientLiveTest {
public CloudStackEC2InstanceClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.KeyPairClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2KeyPairClientLiveTest")
public class CloudStackEC2KeyPairClientLiveTest extends KeyPairClientLiveTest {
public CloudStackEC2KeyPairClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -0,0 +1,34 @@
/**
* 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.cloudstack.ec2.services;
import org.jclouds.ec2.services.SecurityGroupClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", singleThreaded = true, testName = "CloudStackEC2SecurityGroupClientLiveTest")
public class CloudStackEC2SecurityGroupClientLiveTest extends SecurityGroupClientLiveTest {
public CloudStackEC2SecurityGroupClientLiveTest() {
provider = "cloudstack-ec2";
}
}

View File

@ -56,5 +56,6 @@
<module>rds</module>
<module>aws-rds</module>
<module>smartos-ssh</module>
<module>cloudstack-ec2</module>
</modules>
</project>