You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by za...@apache.org on 2015/06/18 21:35:27 UTC
[1/2] jclouds-labs-openstack git commit: Additional support for heat
features. Autovalue refactorings. Rax providers.
Repository: jclouds-labs-openstack
Updated Branches:
refs/heads/master 95df5569d -> 9eea11aa9
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-us/src/main/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadata.java
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-us/src/main/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadata.java b/rackspace-orchestration-us/src/main/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadata.java
new file mode 100644
index 0000000..a870995
--- /dev/null
+++ b/rackspace-orchestration-us/src/main/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadata.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.orchestration.us;
+
+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 static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
+
+import java.net.URI;
+import java.util.Properties;
+
+import org.jclouds.openstack.heat.v1.HeatApiMetadata;
+import org.jclouds.openstack.heat.v1.config.HeatHttpApiModule;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
+import org.jclouds.providers.ProviderMetadata;
+import org.jclouds.providers.internal.BaseProviderMetadata;
+import org.jclouds.rackspace.cloudidentity.v2_0.ServiceType;
+import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule;
+import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule;
+import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes;
+
+import com.google.auto.service.AutoService;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Module;
+
+/**
+ * This is a Rackspace specific provider for Openstack Heat.
+ * Cloud Orchestration is a service that allows you to create, update and manage groups of cloud resources and their
+ * software components as a single unit and then deploy them in an automated, repeatable fashion via a template.
+ *
+ */
+@AutoService(ProviderMetadata.class)
+public class OrchestrationUSProviderMetadata extends BaseProviderMetadata {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @Override
+ public Builder toBuilder() {
+ return builder().fromProviderMetadata(this);
+ }
+
+ public OrchestrationUSProviderMetadata() {
+ this(new Builder());
+ }
+
+ protected OrchestrationUSProviderMetadata(Builder builder) {
+ super(builder);
+ }
+
+ /**
+ * @return a {@link Properties} object containing the default provider properties.
+ * This returns the credential type, service type, and configured regions.
+ */
+ public static Properties defaultProperties() {
+ Properties properties = new Properties();
+ properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS);
+ properties.setProperty(SERVICE_TYPE, ServiceType.ORCHESTRATION);
+
+ properties.setProperty(PROPERTY_REGIONS, "ORD,DFW,IAD,SYD,HKG");
+ properties.setProperty(PROPERTY_REGION + ".ORD." + ISO3166_CODES, "US-IL");
+ properties.setProperty(PROPERTY_REGION + ".DFW." + ISO3166_CODES, "US-TX");
+ properties.setProperty(PROPERTY_REGION + ".IAD." + ISO3166_CODES, "US-VA");
+ properties.setProperty(PROPERTY_REGION + ".SYD." + ISO3166_CODES, "AU-NSW");
+ properties.setProperty(PROPERTY_REGION + ".HKG." + ISO3166_CODES, "HK");
+
+ return properties;
+ }
+
+ public static class Builder extends BaseProviderMetadata.Builder {
+
+ protected Builder() {
+ id("rackspace-orchestration-us")
+ .name("Rackspace Orchestration US")
+ .apiMetadata(new HeatApiMetadata().toBuilder()
+ .identityName("${userName}")
+ .credentialName("${apiKey}")
+ .defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
+ .documentation(
+ URI.create("http://docs.rackspace.com/orchestration/api/v1/orchestration-devguide/content/"))
+ .endpointName("Rackspace Cloud Identity service URL ending in /v2.0/")
+ .version("1")
+ .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
+ .add(CloudIdentityAuthenticationApiModule.class)
+ .add(CloudIdentityAuthenticationModule.class)
+ .add(RegionModule.class)
+ .add(HeatHttpApiModule.class)
+ .build())
+ .build())
+ .homepage(URI.create("http://www.rackspace.com/cloud/orchestration"))
+ .console(URI.create("https://mycloud.rackspace.com"))
+ .linkedServices("rackspace-autoscale-us", "rackspace-cloudblockstorage-us", "rackspace-clouddatabases-us",
+ "rackspace-clouddns-us", "rackspace-cloudidentity", "rackspace-cloudloadbalancers-us",
+ "rackspace-cloudqueues-us", "rackspace-cdn-us")
+ .iso3166Codes("US-IL", "US-TX", "US-VA", "AU-NSW", "HK")
+ .defaultProperties(OrchestrationUSProviderMetadata.defaultProperties());
+
+ }
+
+ @Override
+ public OrchestrationUSProviderMetadata build() {
+ return new OrchestrationUSProviderMetadata(this);
+ }
+
+ @Override
+ public Builder fromProviderMetadata(ProviderMetadata in) {
+ super.fromProviderMetadata(in);
+ return this;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadataTest.java
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadataTest.java b/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadataTest.java
new file mode 100644
index 0000000..1be3850
--- /dev/null
+++ b/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSProviderMetadataTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.orchestration.us;
+
+import org.jclouds.openstack.heat.v1.HeatApiMetadata;
+import org.jclouds.providers.internal.BaseProviderMetadataTest;
+import org.testng.annotations.Test;
+
+/**
+ * Unit tests for the {@link OrchestrationUSProviderMetadata}.
+ */
+@Test(groups = "unit", testName = "OrchestrationUSProviderMetadataTest")
+public class OrchestrationUSProviderMetadataTest extends BaseProviderMetadataTest {
+
+ public OrchestrationUSProviderMetadataTest() {
+ super(new OrchestrationUSProviderMetadata(), new HeatApiMetadata());
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSStackApiLiveTest.java
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSStackApiLiveTest.java b/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSStackApiLiveTest.java
new file mode 100644
index 0000000..790964f
--- /dev/null
+++ b/rackspace-orchestration-us/src/test/java/org/jclouds/rackspace/orchestration/us/OrchestrationUSStackApiLiveTest.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.orchestration.us;
+
+import org.jclouds.openstack.heat.v1.features.StackApiLiveTest;
+import org.testng.annotations.Test;
+
+@Test(groups = "live", testName = "OrchestrationUSStackApiLiveTest")
+public class OrchestrationUSStackApiLiveTest extends StackApiLiveTest {
+ public OrchestrationUSStackApiLiveTest() {
+ provider = "rackspace-orchestration-us";
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-us/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-us/src/test/resources/logback.xml b/rackspace-orchestration-us/src/test/resources/logback.xml
new file mode 100644
index 0000000..d7c463a
--- /dev/null
+++ b/rackspace-orchestration-us/src/test/resources/logback.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF 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.
+
+-->
+<configuration scan="false">
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <file>target/test-data/jclouds.log</file>
+
+ <encoder>
+ <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
+ </encoder>
+ </appender>
+
+ <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender">
+ <file>target/test-data/jclouds-wire.log</file>
+
+ <encoder>
+ <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
+ </encoder>
+ </appender>
+
+ <root>
+ <level value="warn" />
+ </root>
+
+ <logger name="org.jclouds">
+ <level value="DEBUG" />
+ <appender-ref ref="FILE" />
+ </logger>
+
+ <logger name="jclouds.wire">
+ <level value="DEBUG" />
+ <appender-ref ref="WIREFILE" />
+ </logger>
+
+ <logger name="jclouds.headers">
+ <level value="DEBUG" />
+ <appender-ref ref="WIREFILE" />
+ </logger>
+
+</configuration>
[2/2] jclouds-labs-openstack git commit: Additional support for heat
features. Autovalue refactorings. Rax providers.
Posted by za...@apache.org.
Additional support for heat features. Autovalue refactorings. Rax providers.
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/commit/9eea11aa
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/tree/9eea11aa
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/diff/9eea11aa
Branch: refs/heads/master
Commit: 9eea11aa9bda55f0b778e0c8628138d754bad20f
Parents: 95df556
Author: Zack Shoylev <za...@rackspace.com>
Authored: Mon Jun 8 05:52:38 2015 -0500
Committer: Zack Shoylev <za...@rackspace.com>
Committed: Thu Jun 18 14:31:47 2015 -0500
----------------------------------------------------------------------
openstack-heat/pom.xml | 1 -
.../org/jclouds/openstack/heat/v1/HeatApi.java | 9 ++
.../jclouds/openstack/heat/v1/domain/Stack.java | 31 ++--
.../openstack/heat/v1/domain/StackResource.java | 13 +-
.../openstack/heat/v1/domain/Template.java | 57 +++++++
.../openstack/heat/v1/features/StackApi.java | 31 ++--
.../openstack/heat/v1/features/TemplateApi.java | 62 +++++++
.../openstack/heat/v1/options/CreateStack.java | 113 +++----------
.../openstack/heat/v1/options/UpdateStack.java | 66 ++------
.../heat/v1/features/StackApiLiveTest.java | 54 ++++---
.../heat/v1/features/StackApiMockTest.java | 28 ++--
.../heat/v1/features/TemplateApiLiveTest.java | 59 +++++++
.../heat/v1/features/TemplateApiMockTest.java | 126 +++++++++++++++
.../test/resources/files_for_atck_template.json | 4 +-
.../src/test/resources/simple_stack.json | 4 +-
.../resources/stack_post_adopt_request.json | 161 +++++++++++++++++++
.../resources/stack_post_adopt_response.json | 55 +++++++
.../resources/stack_put_update_request.json | 3 +
.../test/resources/template_get_response.json | 50 ++++++
.../resources/template_validate_request.json | 3 +
.../resources/template_validate_response.json | 34 ++++
pom.xml | 4 +-
rackspace-orchestration-uk/README.md | 7 +
rackspace-orchestration-uk/pom.xml | 131 +++++++++++++++
.../uk/OrchestrationUKProviderMetadata.java | 123 ++++++++++++++
.../uk/OrchestrationUKProviderMetadataTest.java | 32 ++++
.../uk/OrchestrationUKStackApiLiveTest.java | 27 ++++
.../src/test/resources/logback.xml | 56 +++++++
rackspace-orchestration-us/README.md | 7 +
rackspace-orchestration-us/pom.xml | 131 +++++++++++++++
.../us/OrchestrationUSProviderMetadata.java | 128 +++++++++++++++
.../us/OrchestrationUSProviderMetadataTest.java | 32 ++++
.../us/OrchestrationUSStackApiLiveTest.java | 27 ++++
.../src/test/resources/logback.xml | 56 +++++++
34 files changed, 1503 insertions(+), 222 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/pom.xml
----------------------------------------------------------------------
diff --git a/openstack-heat/pom.xml b/openstack-heat/pom.xml
index afe7870..da9906d 100644
--- a/openstack-heat/pom.xml
+++ b/openstack-heat/pom.xml
@@ -103,7 +103,6 @@
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
- <version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/HeatApi.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/HeatApi.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/HeatApi.java
index 9197b5a..7e35f17 100644
--- a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/HeatApi.java
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/HeatApi.java
@@ -23,15 +23,18 @@ import org.jclouds.location.Region;
import org.jclouds.location.functions.RegionToEndpoint;
import org.jclouds.openstack.heat.v1.features.ResourceApi;
import org.jclouds.openstack.heat.v1.features.StackApi;
+import org.jclouds.openstack.heat.v1.features.TemplateApi;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.rest.annotations.EndpointParam;
+import com.google.common.annotations.Beta;
import com.google.inject.Provides;
/**
* Provides access to the OpenStack Orchestration (Heat) API.
*
*/
+@Beta
public interface HeatApi extends Closeable {
@Provides
@@ -45,6 +48,12 @@ public interface HeatApi extends Closeable {
ResourceApi getResourceApi(@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
+ * Provides access to Template validation.
+ */
+ @Delegate
+ TemplateApi getTemplateApi(@EndpointParam(parser = RegionToEndpoint.class) String region);
+
+ /**
* Provides access to Stack features.
*/
@Delegate
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Stack.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Stack.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Stack.java
index a103816..ec3cb8f 100644
--- a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Stack.java
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Stack.java
@@ -16,19 +16,19 @@
*/
package org.jclouds.openstack.heat.v1.domain;
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;
import org.jclouds.openstack.v2_0.domain.Link;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.google.auto.value.AutoValue;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
/**
* Representation of an OpenStack Heat Stack.
@@ -69,12 +69,12 @@ public abstract class Stack {
/**
* @return the parameters of this Stack.
*/
- @Nullable public abstract Map<String, String> getParameters();
+ public abstract Map<String, String> getParameters();
/**
* @return the capabilities of this Stack.
*/
- @Nullable public abstract Set<String> getCapabilities();
+ public abstract Set<String> getCapabilities();
/**
* @return the outputs of this Stack.
@@ -84,7 +84,7 @@ public abstract class Stack {
/**
* @return the notification topics of this Stack.
*/
- @Nullable public abstract List<String> getNotificationTopics();
+ public abstract List<String> getNotificationTopics();
/**
* @return the status of this Stack.
@@ -135,10 +135,10 @@ public abstract class Stack {
description,
owner,
project,
- parameters != null ? ImmutableMap.copyOf(parameters) : null,
- capabilities != null ? ImmutableSet.copyOf(capabilities) : null,
- outputs != null ? ImmutableList.copyOf(outputs) : null,
- notificationTopics != null ? ImmutableList.copyOf(notificationTopics) : null,
+ parameters != null ? ImmutableMap.copyOf(parameters) : ImmutableMap.<String, String>of(),
+ capabilities != null ? ImmutableSet.copyOf(capabilities) : ImmutableSet.<String>of(),
+ outputs != null ? ImmutableList.copyOf(outputs) : ImmutableList.<String>of(),
+ notificationTopics != null ? ImmutableList.copyOf(notificationTopics) : ImmutableList.<String>of(),
status,
statusReason,
created,
@@ -148,4 +148,3 @@ public abstract class Stack {
ImmutableSet.copyOf(links));
}
}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/StackResource.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/StackResource.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/StackResource.java
index 5d17764..568a3cf 100644
--- a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/StackResource.java
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/StackResource.java
@@ -16,14 +16,15 @@
*/
package org.jclouds.openstack.heat.v1.domain;
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableSet;
+import java.util.Date;
+import java.util.Set;
+
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;
import org.jclouds.openstack.v2_0.domain.Link;
-import java.util.Date;
-import java.util.Set;
+import com.google.auto.value.AutoValue;
+import com.google.common.collect.ImmutableSet;
/**
* Representation of an OpenStack Heat Stack Resources.
@@ -59,7 +60,7 @@ public abstract class StackResource {
/**
* @return the field required_by
*/
- @Nullable public abstract Set<String> getRequiredBy();
+ public abstract Set<String> getRequiredBy();
/**
* @return the resource type
@@ -85,7 +86,7 @@ public abstract class StackResource {
physicalResourceId,
status,
statusReason,
- requiredBy != null ? ImmutableSet.copyOf(requiredBy) : null,
+ requiredBy != null ? ImmutableSet.copyOf(requiredBy) : ImmutableSet.<String>of(),
resourceType,
updated,
ImmutableSet.copyOf(links));
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Template.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Template.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Template.java
new file mode 100644
index 0000000..819fb52
--- /dev/null
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/domain/Template.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.openstack.heat.v1.domain;
+
+import java.util.Map;
+
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
+
+import com.google.auto.value.AutoValue;
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Representation of an OpenStack Heat Stack Template.
+ */
+@AutoValue
+public abstract class Template {
+
+ /**
+ * @return the description of this Stack Template.
+ */
+ @Nullable public abstract String getDescription();
+
+ /**
+ * @return the parameters of this Stack, such as compute_flavor or compute_image.
+ */
+ public abstract Map<String, Object> getParameters();
+
+ /**
+ * @return the resources of this Stack, such as server_instance.
+ */
+ public abstract Map<String, Object> getResources();
+
+ @SerializedNames({"description", "parameters", "resources"})
+ private static Template create(String description, Map<String, Object> parameters, Map<String, Object> resources) {
+ return new AutoValue_Template(
+ description,
+ parameters != null ? ImmutableMap.copyOf(parameters) : ImmutableMap.<String, Object>of(),
+ resources != null ? ImmutableMap.copyOf(resources) : ImmutableMap.<String, Object>of());
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/StackApi.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/StackApi.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/StackApi.java
index 271d9a4..4763383 100644
--- a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/StackApi.java
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/StackApi.java
@@ -16,6 +16,19 @@
*/
package org.jclouds.openstack.heat.v1.features;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.MediaType;
+
import org.jclouds.Fallbacks.EmptyListOnNotFoundOr404;
import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404;
import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
@@ -23,6 +36,7 @@ import org.jclouds.Fallbacks.NullOnNotFoundOr404;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.openstack.heat.v1.domain.Stack;
import org.jclouds.openstack.heat.v1.domain.StackResource;
+import org.jclouds.openstack.heat.v1.domain.Template;
import org.jclouds.openstack.heat.v1.options.CreateStack;
import org.jclouds.openstack.heat.v1.options.ListStackOptions;
import org.jclouds.openstack.heat.v1.options.UpdateStack;
@@ -33,18 +47,6 @@ import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.SelectJson;
import org.jclouds.rest.binders.BindToJsonPayload;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.MediaType;
-import java.util.List;
-import java.util.Map;
-
/**
* Provides access to the OpenStack Orchestration (Heat) Stack API features.
@@ -120,4 +122,9 @@ public interface StackApi {
@Fallback(EmptyMapOnNotFoundOr404.class)
Map<String, Object> getStackResourceMetadata(@PathParam("stack_name") String stackName, @PathParam("stack_id") String stackId, @PathParam("resource_name") String name);
+ @Named("stack:get_template")
+ @GET
+ @Path("/{stack_name}/{stack_id}/template")
+ @Fallback(NullOnNotFoundOr404.class)
+ Template getTemplate(@PathParam("stack_name") String stackName, @PathParam("stack_id") String stackId);
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/TemplateApi.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/TemplateApi.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/TemplateApi.java
new file mode 100644
index 0000000..6c2234a
--- /dev/null
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/features/TemplateApi.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.openstack.heat.v1.features;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.openstack.heat.v1.domain.Template;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.Payload;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+
+/**
+ * Provides access to Resource features.
+ *
+ */
+@RequestFilters(AuthenticateRequest.class)
+public interface TemplateApi {
+
+ /**
+ * Normal response codes: 200
+
+ Error response codes: badRequest (400), unauthorized (401), notFound (404), internalServerError (500)
+ */
+ @Named("validation:validate_template")
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/validate")
+ @Payload("%7B\"template_url\":\"{url}\"%7D")
+ Template validate(@PayloadParam("url") String template_url);
+
+ @Named("validation:get_template")
+ @GET
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Path("/stacks/{stack_name}/{stack_id}/template")
+ @Fallback(NullOnNotFoundOr404.class)
+ Template get(@PathParam("stack_name") String name, @PathParam("stack_id") String id);
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java
index 864d090..44201c6 100644
--- a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java
@@ -16,12 +16,13 @@
*/
package org.jclouds.openstack.heat.v1.options;
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;
-import java.util.Map;
+import com.google.auto.value.AutoValue;
+import com.google.common.collect.ImmutableMap;
/**
* Representation of create stack options.
@@ -64,10 +65,6 @@ public abstract class CreateStack {
*/
@Nullable public abstract String getEnvironment();
- public static Builder builder() {
- return new AutoValue_CreateStack.Builder().disableRollback(true).files(null).environment(null);
- }
-
public Builder toBuilder() {
return builder()
.name(getName())
@@ -91,95 +88,29 @@ public abstract class CreateStack {
.environment(environment).build();
}
- public static final class Builder {
-
- private String name;
- private String template;
- private String templateUrl;
- private Map<String, Object> parameters;
- private boolean disableRollback = true;
- private Map<String, String> files;
- private String environment;
-
- Builder() {
- }
-
- Builder(CreateStack source) {
- name(source.getName());
- template(source.getTemplate());
- templateUrl(source.getTemplateUrl());
- parameters(source.getParameters());
- disableRollback(source.isDisableRollback());
- files(source.getFiles());
- environment(source.getEnvironment());
- }
-
- /**
- * @param name - The name of the stack
- */
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @param template - The stack template to instantiate.
- */
- public Builder template(String template) {
- this.template = template;
- return this;
- }
-
- /**
- * @param templateUrl - A URI to the location containing the stack template to instantiate.
- */
- public Builder templateUrl(String templateUrl) {
- this.templateUrl = templateUrl;
- return this;
- }
-
- /**
- * @param parameters - The properties for the template
- */
- public Builder parameters(Map<String, Object> parameters) {
- this.parameters = parameters;
- return this;
- }
+ public static Builder builder() {
+ return new AutoValue_CreateStack.Builder().disableRollback(true).files(null).environment(null);
+ }
- /**
- * @param disableRollback - Controls whether a failure during stack creation causes deletion of all previously-created resources in that stack. The default is True
- */
- public Builder disableRollback(boolean disableRollback) {
- this.disableRollback = disableRollback;
- return this;
- }
+ @AutoValue.Builder
+ public abstract static class Builder {
+ public abstract Builder name(String name);
+ public abstract Builder template(String template);
+ public abstract Builder templateUrl(String templateUrl);
+ public abstract Builder parameters(Map<String, Object> parameters);
+ public abstract Builder disableRollback(boolean disableRollback);
+ public abstract Builder files(Map<String, String> files);
+ public abstract Builder environment(String environment);
- /**
- * @param files - The properties for the template
- */
- public Builder files(Map<String, String> files) {
- this.files = files;
- return this;
- }
+ abstract Map<String, Object> getParameters();
+ abstract Map<String, String> getFiles();
- /**
- * @param environment - used to affect the runtime behaviour of the template
- */
- public Builder environment(String environment) {
- this.environment = environment;
- return this;
- }
+ abstract CreateStack autoBuild();
public CreateStack build() {
- CreateStack result = new AutoValue_CreateStack(
- this.name,
- this.template,
- this.templateUrl,
- this.parameters != null ? ImmutableMap.copyOf(this.parameters) : null,
- this.disableRollback,
- this.files != null ? ImmutableMap.copyOf(this.files) : null,
- this.environment);
- return result;
+ parameters(getParameters() != null ? ImmutableMap.copyOf(getParameters()) : null);
+ files(getFiles() != null ? ImmutableMap.copyOf(getFiles()) : null);
+ return autoBuild();
}
}
}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/UpdateStack.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/UpdateStack.java b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/UpdateStack.java
index 355f767..974ab9c 100644
--- a/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/UpdateStack.java
+++ b/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/UpdateStack.java
@@ -16,13 +16,13 @@
*/
package org.jclouds.openstack.heat.v1.options;
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableMap;
+import java.util.Map;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;
-import java.util.Map;
+import com.google.auto.value.AutoValue;
+import com.google.common.collect.ImmutableMap;
/**
* Representation of updatable options
@@ -46,15 +46,10 @@ public abstract class UpdateStack {
@Nullable public abstract Map<String, Object> getParameters();
public static Builder builder() {
- return new AutoValue_UpdateStack.Builder().parameters(null);
+ return new AutoValue_UpdateStack.Builder();
}
- public Builder toBuilder() {
- return builder()
- .template(getTemplate())
- .templateUrl(getTemplateUrl())
- .parameters(getParameters());
- }
+ public abstract Builder toBuilder();
@SerializedNames({"template", "template_url", "parameters"})
private static UpdateStack create(@Nullable String template, @Nullable String templateUrl, @Nullable Map<String, Object> parameters) {
@@ -65,52 +60,19 @@ public abstract class UpdateStack {
}
- public static final class Builder {
-
- private String template;
- private String templateUrl;
- private Map<String, Object> parameters;
+ @AutoValue.Builder
+ public abstract static class Builder {
+ public abstract Builder template(String template);
+ public abstract Builder templateUrl(String templateUrl);
+ public abstract Builder parameters(Map<String, Object> parameters);
- Builder() {
- }
+ abstract Map<String, Object> getParameters();
- Builder(CreateStack source) {
- template(source.getTemplate());
- templateUrl(source.getTemplateUrl());
- parameters(source.getParameters());
- }
-
- /**
- * @see UpdateStack#getTemplate()
- */
- public Builder template(String template) {
- this.template = template;
- return this;
- }
-
- /**
- * @see UpdateStack#getTemplateUrl()
- */
- public Builder templateUrl(String templateUrl) {
- this.templateUrl = templateUrl;
- return this;
- }
-
- /**
- * @see UpdateStack#getParameters()
- */
- public Builder parameters(Map<String, Object> parameters) {
- this.parameters = parameters;
- return this;
- }
+ abstract UpdateStack autoBuild();
public UpdateStack build() {
- UpdateStack result = new AutoValue_UpdateStack(
- this.template,
- this.templateUrl,
- parameters != null ? ImmutableMap.copyOf(this.parameters) : null);
- return result;
+ parameters(getParameters() != null ? ImmutableMap.copyOf(getParameters()) : null);
+ return autoBuild();
}
}
}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiLiveTest.java b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiLiveTest.java
index f9e30a0..c7aa64b 100644
--- a/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiLiveTest.java
+++ b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiLiveTest.java
@@ -16,8 +16,16 @@
*/
package org.jclouds.openstack.heat.v1.features;
-import com.google.common.base.Predicate;
-import com.google.common.base.Throwables;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.jclouds.util.Predicates2.retry;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
import org.jclouds.openstack.heat.v1.domain.Stack;
import org.jclouds.openstack.heat.v1.domain.StackResource;
import org.jclouds.openstack.heat.v1.domain.StackResourceStatus;
@@ -33,14 +41,8 @@ import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.jclouds.util.Predicates2.retry;
+import com.google.common.base.Predicate;
+import com.google.common.base.Throwables;
/**
* Tests parsing and Guice wiring of StackApi
@@ -48,7 +50,7 @@ import static org.jclouds.util.Predicates2.retry;
@Test(groups = "live", testName = "StackApiLiveTest")
public class StackApiLiveTest extends BaseHeatApiLiveTest {
- public static final String TEMPLATE_URL = "http://10.5.5.121/Installs/cPaaS/YAML/simple_stack.yaml";
+ public static final String TEMPLATE_URL = "https://raw.githubusercontent.com/rackspace-orchestration-templates/wordpress-single/master/wordpress-single.yaml";
protected String stackName = System.getProperty("user.name").replace('.', '-').toLowerCase();
public void testList() {
@@ -167,7 +169,7 @@ public class StackApiLiveTest extends BaseHeatApiLiveTest {
return stackApi.get(stackId).getStatus() == StackStatus.CREATE_COMPLETE;
}
- }, 60, 1, SECONDS).apply(stackId);
+ }, 600, 60, SECONDS).apply(stackId);
if (!success) {
Assert.fail("Stack didn't get to status CREATE_COMPLETE in 20m.");
@@ -185,7 +187,7 @@ public class StackApiLiveTest extends BaseHeatApiLiveTest {
for (String region : api.getConfiguredRegions()) {
StackApi stackApi = api.getStackApi(region);
Map<String, Object> parameters = new HashMap<String, Object>();
- parameters.put("key_name", "myKey");
+ parameters.put("key_name", UUID.randomUUID());
JSONParser parser = new JSONParser();
Object obj = parser.parse(stringFromResource("/stack_with_parameters.json"));
@@ -239,7 +241,7 @@ public class StackApiLiveTest extends BaseHeatApiLiveTest {
JSONObject jsonObject = (JSONObject) obj;
Map<String, Object> parameters = new HashMap<String, Object>();
- parameters.put("key_name", "myKey");
+ parameters.put("key_name", UUID.randomUUID());
String stackName = getName();
CreateStack createStack = CreateStack.builder().name(stackName).template(String.valueOf(jsonObject.get("template"))).parameters(parameters).build();
@@ -291,20 +293,20 @@ public class StackApiLiveTest extends BaseHeatApiLiveTest {
}
}
- @AfterClass
- public void cleanup(){
+ @AfterClass
+ public void cleanup() {
- for (String region : api.getConfiguredRegions()) {
- StackApi stackApi = api.getStackApi(region);
- List<Stack> stacks = stackApi.list();
- for (Stack stack : stacks){
- if (stack.getName().startsWith(stackName)){
- stackApi.delete(stack.getName(), stack.getId());
- }
- }
- }
+ for (String region : api.getConfiguredRegions()) {
+ StackApi stackApi = api.getStackApi(region);
+ List<Stack> stacks = stackApi.list();
+ for (Stack stack : stacks) {
+ if (stack.getName().startsWith(stackName)) {
+ stackApi.delete(stack.getName(), stack.getId());
+ }
+ }
+ }
- }
+ }
private String getName() {
return stackName + "_" + System.currentTimeMillis();
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiMockTest.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiMockTest.java b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiMockTest.java
index 54ce022..841c41a 100644
--- a/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiMockTest.java
+++ b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiMockTest.java
@@ -16,8 +16,17 @@
*/
package org.jclouds.openstack.heat.v1.features;
-import com.squareup.okhttp.mockwebserver.MockResponse;
-import com.squareup.okhttp.mockwebserver.MockWebServer;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.jclouds.openstack.heat.v1.HeatApi;
import org.jclouds.openstack.heat.v1.domain.Stack;
import org.jclouds.openstack.heat.v1.domain.StackResource;
@@ -27,16 +36,8 @@ import org.jclouds.openstack.heat.v1.options.ListStackOptions;
import org.jclouds.openstack.heat.v1.options.UpdateStack;
import org.testng.annotations.Test;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
+import com.squareup.okhttp.mockwebserver.MockResponse;
+import com.squareup.okhttp.mockwebserver.MockWebServer;
/**
* Tests annotation parsing of {@code StackApi}
@@ -478,7 +479,8 @@ public class StackApiMockTest extends BaseHeatApiMockTest {
*/
assertEquals(server.getRequestCount(), 2);
assertAuthentication(server);
- assertRequest(server.takeRequest(), "PUT", BASE_URI + "/stacks/" + TEST_STACK_NAME + "/" + TEST_STACK_ID);
+ assertRequest(server.takeRequest(), "PUT", BASE_URI + "/stacks/" + TEST_STACK_NAME + "/" + TEST_STACK_ID,
+ "/stack_put_update_request.json");
/*
* Check response
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiLiveTest.java b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiLiveTest.java
new file mode 100644
index 0000000..8fd093c
--- /dev/null
+++ b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiLiveTest.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.openstack.heat.v1.features;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.jclouds.openstack.heat.v1.domain.Stack;
+import org.jclouds.openstack.heat.v1.domain.Template;
+import org.jclouds.openstack.heat.v1.internal.BaseHeatApiLiveTest;
+import org.testng.annotations.Test;
+
+/**
+ * Tests parsing and Guice wiring of StackApi
+ */
+@Test(groups = "live", testName = "StackApiLiveTest")
+public class TemplateApiLiveTest extends BaseHeatApiLiveTest {
+ public void testGetTemplate() {
+ for (String region : api.getConfiguredRegions()) {
+ StackApi stackApi = api.getStackApi(region);
+ TemplateApi templateApi = api.getTemplateApi(region);
+
+ List<Stack> stacks = stackApi.list();
+ assertThat(stacks).isNotNull();
+
+ Stack stack = stackApi.get(stacks.get(0).getId());
+ assertThat(stack).isNotNull();
+ assertThat(stack.getId()).isEqualTo(stacks.get(0).getId());
+
+ Template template = templateApi.get(stack.getName(), stack.getId());
+ assertThat(template).isNotNull();
+ }
+ }
+
+ public void testValidateTemplate() {
+ for (String region : api.getConfiguredRegions()) {
+ TemplateApi templateApi = api.getTemplateApi(region);
+
+ Template template = templateApi.validate(
+ "https://raw.githubusercontent.com/openstack/heat-templates/master/contrib/rackspace/RackspaceAutoScale.yaml");
+ assertThat(template).isNotNull();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiMockTest.java
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiMockTest.java b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiMockTest.java
new file mode 100644
index 0000000..a8d8e12
--- /dev/null
+++ b/openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiMockTest.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.openstack.heat.v1.features;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+
+import org.jclouds.openstack.heat.v1.HeatApi;
+import org.jclouds.openstack.heat.v1.domain.Template;
+import org.jclouds.openstack.heat.v1.internal.BaseHeatApiMockTest;
+import org.jclouds.rest.ResourceNotFoundException;
+import org.testng.annotations.Test;
+
+import com.squareup.okhttp.mockwebserver.MockResponse;
+import com.squareup.okhttp.mockwebserver.MockWebServer;
+
+/**
+ * Tests annotation parsing of {@code StackApi}
+ */
+@Test(groups = "unit", testName = "StackApiMockTest")
+public class TemplateApiMockTest extends BaseHeatApiMockTest {
+
+ public void testGetTemplate() throws Exception {
+ MockWebServer server = mockOpenStackServer();
+ server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
+ server.enqueue(addCommonHeaders(
+ new MockResponse().setResponseCode(200).setBody(stringFromResource("/template_get_response.json"))));
+
+ try {
+ HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides);
+ TemplateApi api = heatApi.getTemplateApi("RegionOne");
+
+ Template template = api.get("simple_stack", "3095aefc-09fb-4bc7-b1f0-f21a304e864c");
+
+ assertThat(server.getRequestCount()).isEqualTo(2);
+ assertAuthentication(server);
+ assertRequest(server.takeRequest(), "GET",
+ BASE_URI + "/stacks/simple_stack/3095aefc-09fb-4bc7-b1f0-f21a304e864c/template");
+
+ assertThat(template).isNotNull();
+ assertEquals(template.getDescription(), "Heat Orchestration Template that spins up a single server");
+ } finally {
+ server.shutdown();
+ }
+ }
+
+ public void testGetTemplateFail() throws Exception {
+ MockWebServer server = mockOpenStackServer();
+ server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
+ server.enqueue(addCommonHeaders(
+ new MockResponse().setResponseCode(404).setBody(stringFromResource("/template_get_response.json"))));
+
+ try {
+ HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides);
+ TemplateApi api = heatApi.getTemplateApi("RegionOne");
+
+ Template template = api.get("simple_stack", "3095aefc-09fb-4bc7-b1f0-f21a304e864c");
+
+ assertNull(template);
+ assertAuthentication(server);
+ assertRequest(server.takeRequest(), "GET",
+ BASE_URI + "/stacks/simple_stack/3095aefc-09fb-4bc7-b1f0-f21a304e864c/template");
+ } finally {
+ server.shutdown();
+ }
+ }
+
+ public void testValidateTemplate() throws Exception {
+ MockWebServer server = mockOpenStackServer();
+ server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
+ server.enqueue(addCommonHeaders(
+ new MockResponse().setResponseCode(200).setBody(stringFromResource("/template_validate_response.json"))));
+
+ try {
+ HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides);
+ TemplateApi api = heatApi.getTemplateApi("RegionOne");
+
+ Template template = api.validate("https://examplevalidateurl.com/exampletemplate.json");
+
+ assertThat(server.getRequestCount()).isEqualTo(2);
+ assertAuthentication(server);
+ assertRequest(server.takeRequest(), "POST",
+ BASE_URI + "/validate", "/template_validate_request.json");
+
+ assertThat(template).isNotNull();
+ assertEquals("A template implementation of a resource that provides a single MongoDB server instance",
+ template.getDescription());
+ } finally {
+ server.shutdown();
+ }
+ }
+
+ @Test(expectedExceptions = ResourceNotFoundException.class)
+ public void testValidateTemplateFail() throws Exception {
+ MockWebServer server = mockOpenStackServer();
+ server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
+ server.enqueue(addCommonHeaders(
+ new MockResponse().setResponseCode(404).setBody(stringFromResource("/template_validate_response.json"))));
+
+ try {
+ HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides);
+ TemplateApi api = heatApi.getTemplateApi("RegionOne");
+
+ Template template = api.validate("https://examplevalidateurl.com/exampletemplate.json");
+
+ } finally {
+ server.shutdown();
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/files_for_atck_template.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/files_for_atck_template.json b/openstack-heat/src/test/resources/files_for_atck_template.json
index c0b20de..69e87a8 100644
--- a/openstack-heat/src/test/resources/files_for_atck_template.json
+++ b/openstack-heat/src/test/resources/files_for_atck_template.json
@@ -16,7 +16,7 @@
"description": "Template to set up volumes for the initial deployment",
"parameters": {
"storage_size": {
- "default": "4",
+ "default": "80",
"description": "GBs for block storage",
"type": "number"
}
@@ -30,4 +30,4 @@
}
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/simple_stack.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/simple_stack.json b/openstack-heat/src/test/resources/simple_stack.json
index 22fd8bb..8035a47 100644
--- a/openstack-heat/src/test/resources/simple_stack.json
+++ b/openstack-heat/src/test/resources/simple_stack.json
@@ -8,7 +8,7 @@
"cinder_volume": {
"type": "OS::Cinder::Volume",
"properties": {
- "size": "1"
+ "size": "80"
},
"metadata": {
"some_key": "some_value",
@@ -18,4 +18,4 @@
}
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/stack_post_adopt_request.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/stack_post_adopt_request.json b/openstack-heat/src/test/resources/stack_post_adopt_request.json
new file mode 100644
index 0000000..bd933e4
--- /dev/null
+++ b/openstack-heat/src/test/resources/stack_post_adopt_request.json
@@ -0,0 +1,161 @@
+{
+ "files": {
+
+ },
+ "disable_rollback": true,
+ "parameters": {
+
+ },
+ "stack_name": "stackadopted",
+ "adopt_stack_data": "{\n \"status\": \"COMPLETE\",\n \"name\": \"trovestack\",\n \"template\": {\n \"outputs\": {\n \"db_host\": {\n \"value\": {\n \"get_attr\": [\n \"db\",\n \"hostname\"\n ]\n }\n }\n },\n \"heat_template_version\": \"2014-10-16\",\n \"description\": \"HEAT template for creating a Cloud Database.\\n\",\n \"parameters\": {\n \"db_instance_name\": {\n \"default\": \"Cloud_DB\",\n \"type\": \"string\",\n \"description\": \"the database instance name\"\n },\n \"db_flavor\": {\n \"default\": \"1GB Instance\",\n \"type\": \"string\",\n \"description\": \"database instance size\",\n \"constraints\": [\n {\n \"description\": \"must be a valid cloud database flavor\",\n \"allowed_values\": [\n \"1GB Instance\",\n \"2GB Instance\",\n \"4GB Instance\",\n
\"8GB Instance\",\n \"16GB Instance\"\n ]\n }\n ]\n },\n \"db_password\": {\n \"default\": \"admin\",\n \"hidden\": true,\n \"type\": \"string\",\n \"description\": \"database admin account password\",\n \"constraints\": [\n {\n \"length\": {\n \"max\": 41,\n \"min\": 1\n },\n \"description\": \"must be between 1 and 14 characters\"\n },\n {\n \"allowed_pattern\": \"[a-zA-Z0-9]*\",\n \"description\": \"must contain only alphanumeric characters.\"\n }\n ]\n },\n \"db_name\": {\n \"default\": \"wordpress\",\n \"type\": \"string\",\n \"description\": \"the name for the database\",\n \"constraints\": [\n {\n \"length\": {\n \"max\": 64,\n \"min\": 1\n },\n \"description\
": \"must be between 1 and 64 characters\"\n },\n {\n \"allowed_pattern\": \"[a-zA-Z][a-zA-Z0-9]*\",\n \"description\": \"must begin with a letter and contain only alphanumeric characters.\"\n }\n ]\n },\n \"db_username\": {\n \"default\": \"admin\",\n \"hidden\": true,\n \"type\": \"string\",\n \"description\": \"database admin account username\",\n \"constraints\": [\n {\n \"length\": {\n \"max\": 16,\n \"min\": 1\n },\n \"description\": \"must be between 1 and 16 characters\"\n },\n {\n \"allowed_pattern\": \"[a-zA-Z][a-zA-Z0-9]*\",\n \"description\": \"must begin with a letter and contain only alphanumeric characters.\"\n }\n ]\n },\n \"db_volume_size\": {\n \"default\": 30,\n \"type\": \"number\",\n \"description\": \"database
volume size (in GB)\",\n \"constraints\": [\n {\n \"range\": {\n \"max\": 1024,\n \"min\": 1\n },\n \"description\": \"must be between 1 and 1024 GB\"\n }\n ]\n }\n },\n \"resources\": {\n \"db\": {\n \"type\": \"OS::Trove::Instance\",\n \"properties\": {\n \"flavor\": {\n \"get_param\": \"db_flavor\"\n },\n \"databases\": [\n {\n \"name\": {\n \"get_param\": \"db_name\"\n }\n }\n ],\n \"users\": [\n {\n \"password\": {\n \"get_param\": \"db_password\"\n },\n \"name\": {\n \"get_param\": \"db_username\"\n },\n \"databases\": [\n {\n \"get_param\": \"db_name\"\n }\n ]\n }\n
],\n \"name\": {\n \"get_param\": \"db_instance_name\"\n },\n \"size\": {\n \"get_param\": \"db_volume_size\"\n }\n }\n }\n }\n },\n \"action\": \"CREATE\",\n \"id\": \"exxxxd-7xx5-4xxb-bxx2-cxxxxxx5\",\n \"resources\": {\n \"db\": {\n \"status\": \"COMPLETE\",\n \"name\": \"db\",\n \"resource_data\": {},\n \"resource_id\": \"exxxx2-9xx0-4xxxb-bxx2-dxxxxxx4\",\n \"action\": \"CREATE\",\n \"type\": \"OS::Trove::Instance\",\n \"metadata\": {}\n }\n }\n}\n",
+ "environment": {
+
+ },
+ "template": {
+ "outputs": {
+ "db_host": {
+ "value": {
+ "get_attr": [
+ "db",
+ "hostname"
+ ]
+ }
+ }
+ },
+ "heat_template_version": "2014-10-16",
+ "description": "HEAT template for creating a Cloud Database.\n",
+ "parameters": {
+ "db_name": {
+ "default": "wordpress",
+ "type": "string",
+ "description": "the name for the database",
+ "constraints": [
+ {
+ "length": {
+ "max": 64,
+ "min": 1
+ },
+ "description": "must be between 1 and 64 characters"
+ },
+ {
+ "allowed_pattern": "[a-zA-Z][a-zA-Z0-9]*",
+ "description": "must begin with a letter and contain only alphanumeric characters."
+ }
+ ]
+ },
+ "db_instance_name": {
+ "default": "Cloud_DB",
+ "type": "string",
+ "description": "the database instance name"
+ },
+ "db_username": {
+ "default": "admin",
+ "hidden": true,
+ "type": "string",
+ "description": "database admin account username",
+ "constraints": [
+ {
+ "length": {
+ "max": 16,
+ "min": 1
+ },
+ "description": "must be between 1 and 16 characters"
+ },
+ {
+ "allowed_pattern": "[a-zA-Z][a-zA-Z0-9]*",
+ "description": "must begin with a letter and contain only alphanumeric characters."
+ }
+ ]
+ },
+ "db_volume_size": {
+ "default": 30,
+ "type": "number",
+ "description": "database volume size (in GB)",
+ "constraints": [
+ {
+ "range": {
+ "max": 1024,
+ "min": 1
+ },
+ "description": "must be between 1 and 1024 GB"
+ }
+ ]
+ },
+ "db_flavor": {
+ "default": "1GB Instance",
+ "type": "string",
+ "description": "database instance size",
+ "constraints": [
+ {
+ "description": "must be a valid cloud database flavor",
+ "allowed_values": [
+ "1GB Instance",
+ "2GB Instance",
+ "4GB Instance",
+ "8GB Instance",
+ "16GB Instance"
+ ]
+ }
+ ]
+ },
+ "db_password": {
+ "default": "admin",
+ "hidden": true,
+ "type": "string",
+ "description": "database admin account password",
+ "constraints": [
+ {
+ "length": {
+ "max": 41,
+ "min": 1
+ },
+ "description": "must be between 1 and 14 characters"
+ },
+ {
+ "allowed_pattern": "[a-zA-Z0-9]*",
+ "description": "must contain only alphanumeric characters."
+ }
+ ]
+ }
+ },
+ "resources": {
+ "db": {
+ "type": "OS::Trove::Instance",
+ "properties": {
+ "flavor": {
+ "get_param": "db_flavor"
+ },
+ "size": {
+ "get_param": "db_volume_size"
+ },
+ "users": [
+ {
+ "password": {
+ "get_param": "db_password"
+ },
+ "name": {
+ "get_param": "db_username"
+ },
+ "databases": [
+ {
+ "get_param": "db_name"
+ }
+ ]
+ }
+ ],
+ "name": {
+ "get_param": "db_instance_name"
+ },
+ "databases": [
+ {
+ "name": {
+ "get_param": "db_name"
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "timeout_mins": 60
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/stack_post_adopt_response.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/stack_post_adopt_response.json b/openstack-heat/src/test/resources/stack_post_adopt_response.json
new file mode 100644
index 0000000..6728eb2
--- /dev/null
+++ b/openstack-heat/src/test/resources/stack_post_adopt_response.json
@@ -0,0 +1,55 @@
+{
+ "status": "COMPLETE",
+ "name": "trove",
+ "template": {
+ "heat-template-version": "2014-10-16",
+ "resources": {
+ "MySqlCloudDatabaseServer": {
+ "type": "OS::Trove::Instance",
+ "properties": {
+ "flavor": "1GB Instance",
+ "databases": [
+ {
+ "name": "testdbonetwo"
+ }
+ ],
+ "users": [
+ {
+ "password": "testpass123",
+ "name": "testuser",
+ "databases": [
+ "testdbonetwo"
+ ]
+ }
+ ],
+ "name": "test-trove-db",
+ "size": 30
+ }
+ }
+ },
+ "description": "MYSQL server cloud database instance running on Rackspace cloud",
+ "parameters": {
+ "instance_name": {
+ "type": "String",
+ "description": "The database instance name"
+ }
+ }
+ },
+ "action": "CREATE",
+ "id": "46c927bb-671a-43db-a29c-16a2610865ca",
+ "resources": {
+ "MySqlCloudDatabaseServer": {
+ "status": "COMPLETE",
+ "name": "MySqlCloudDatabaseServer",
+ "resource_data": {
+
+ },
+ "resource_id": "74c5be7e-3e62-41e7-b455-93d1c32d56e3",
+ "action": "CREATE",
+ "type": "OS::Trove::Instance",
+ "metadata": {
+
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/stack_put_update_request.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/stack_put_update_request.json b/openstack-heat/src/test/resources/stack_put_update_request.json
new file mode 100644
index 0000000..e4df62f
--- /dev/null
+++ b/openstack-heat/src/test/resources/stack_put_update_request.json
@@ -0,0 +1,3 @@
+{
+ "template_url": "http://10.5.5.121/Installs/cPaaS/YAML/simple_stack.yaml"
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/template_get_response.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/template_get_response.json b/openstack-heat/src/test/resources/template_get_response.json
new file mode 100644
index 0000000..8e22844
--- /dev/null
+++ b/openstack-heat/src/test/resources/template_get_response.json
@@ -0,0 +1,50 @@
+{
+ "description": "Heat Orchestration Template that spins up a single server",
+ "heat_template_version": "2014-10-16",
+ "parameters": {
+ "compute_flavor": {
+ "constraints": [
+ {
+ "allowed_values": [
+ "1 GB General Purpose v1",
+ "2 GB General Purpose v1",
+ "4 GB General Purpose v1",
+ "8 GB General Purpose v1"
+ ],
+ "description": "Must be a valid Rackspace Cloud Server flavor."
+ }
+ ],
+ "default": "2 GB General Purpose v1",
+ "description": "flavor id for the compute instance",
+ "type": "String"
+ },
+ "compute_image": {
+ "constraints": [
+ {
+ "allowed_values": [
+ "Ubuntu 13.10 (Saucy Salamander)",
+ "Ubuntu 12.10 (Quantal Quetzal)"
+ ],
+ "description": "Must be a valid Rackspace Cloud Server image name."
+ }
+ ],
+ "default": "Ubuntu 13.10 (Saucy Salamander)",
+ "description": "The Image to use for the host OS.",
+ "type": "String"
+ }
+ },
+ "resources": {
+ "server_instance": {
+ "type": "OS::Nova::Server",
+ "properties": {
+ "flavor": {
+ "get_param": "compute_flavor"
+ },
+ "image": {
+ "get_param": "compute_image"
+ },
+ "name": "Single Node Compute Instance"
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/template_validate_request.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/template_validate_request.json b/openstack-heat/src/test/resources/template_validate_request.json
new file mode 100644
index 0000000..2498fbb
--- /dev/null
+++ b/openstack-heat/src/test/resources/template_validate_request.json
@@ -0,0 +1,3 @@
+{
+ "template_url": "https://examplevalidateurl.com/exampletemplate.json"
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/openstack-heat/src/test/resources/template_validate_response.json
----------------------------------------------------------------------
diff --git a/openstack-heat/src/test/resources/template_validate_response.json b/openstack-heat/src/test/resources/template_validate_response.json
new file mode 100644
index 0000000..6fe7c44
--- /dev/null
+++ b/openstack-heat/src/test/resources/template_validate_response.json
@@ -0,0 +1,34 @@
+{
+ "description": "A template implementation of a resource that provides a single MongoDB server instance",
+ "parameters": {
+ "flavor": {
+ "Default": "1GB Standard Instance",
+ "Description": "Rackspace Cloud Server flavor",
+ "Type": "String",
+ "constraints": [
+ {
+ "allowed_values": [
+ "512MB Standard Instance",
+ "1GB Standard Instance",
+ "2GB Standard Instance",
+ "4GB Standard Instance",
+ "8GB Standard Instance",
+ "15GB Standard Instance",
+ "30GB Standard Instance"
+ ],
+ "description": "must be a valid Rackspace Cloud Server flavor."
+ }
+ ]
+ },
+ "key_name": {
+ "Description": "Nova keypair name for ssh access to the server",
+ "Required": true,
+ "Type": "String"
+ },
+ "server_name": {
+ "Default": "MongoDB_One",
+ "Description": "the instance name",
+ "Type": "String"
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 70c8f7b..31d5c7a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,11 +65,13 @@
<module>rackspace-cloudqueues-us</module>
<module>rackspace-cloudqueues-uk</module>
<module>rackspace-cloudbigdata</module>
- <module>rackspace-cloudbigdata-us</module>
+ <module>rackspace-cloudbigdata-us</module>
<module>rackspace-cloudnetworks-uk</module>
<module>rackspace-cloudnetworks-us</module>
<module>rackspace-cdn-uk</module>
<module>rackspace-cdn-us</module>
+ <module>rackspace-orchestration-us</module>
+ <module>rackspace-orchestration-uk</module>
</modules>
<profiles>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-uk/README.md
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-uk/README.md b/rackspace-orchestration-uk/README.md
new file mode 100644
index 0000000..9764208
--- /dev/null
+++ b/rackspace-orchestration-uk/README.md
@@ -0,0 +1,7 @@
+Rackspace Orchestration UK
+========================
+
+The Rackspace Orchestration Provider for the US region.
+
+Production ready?
+No
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-uk/pom.xml
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-uk/pom.xml b/rackspace-orchestration-uk/pom.xml
new file mode 100644
index 0000000..cda2003
--- /dev/null
+++ b/rackspace-orchestration-uk/pom.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF 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.apache.jclouds</groupId>
+ <artifactId>jclouds-project</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <!-- TODO: when out of labs, switch to org.jclouds.provider -->
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>rackspace-orchestration-uk</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <name>jclouds Rackspace Orchestration UK provider</name>
+ <description>OpenStack Heat implementation targeted to Rackspace Orchestration UK</description>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <!-- identity endpoint -->
+ <test.rackspace-orchestration-uk.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-orchestration-uk.endpoint>
+ <test.rackspace-orchestration-uk.api-version>1</test.rackspace-orchestration-uk.api-version>
+ <test.rackspace-orchestration-uk.build-version />
+ <test.rackspace-orchestration-uk.identity>${test.rackspace-uk.identity}</test.rackspace-orchestration-uk.identity>
+ <test.rackspace-orchestration-uk.credential>${test.rackspace-uk.credential}</test.rackspace-orchestration-uk.credential>
+ <jclouds.osgi.export>org.jclouds.rackspace.orchestration.uk*;version="${project.version}"</jclouds.osgi.export>
+ <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>openstack-heat</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>rackspace-cloudidentity</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>openstack-heat</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-core</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.driver</groupId>
+ <artifactId>jclouds-slf4j</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.auto.service</groupId>
+ <artifactId>auto-service</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ <version>1.1</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.rackspace-orchestration-uk.endpoint>${test.rackspace-orchestration-uk.endpoint}</test.rackspace-orchestration-uk.endpoint>
+ <test.rackspace-orchestration-uk.api-version>${test.rackspace-orchestration-uk.api-version}</test.rackspace-orchestration-uk.api-version>
+ <test.rackspace-orchestration-uk.build-version>${test.rackspace-orchestration-uk.build-version}</test.rackspace-orchestration-uk.build-version>
+ <test.rackspace-orchestration-uk.identity>${test.rackspace-orchestration-uk.identity}</test.rackspace-orchestration-uk.identity>
+ <test.rackspace-orchestration-uk.credential>${test.rackspace-orchestration-uk.credential}</test.rackspace-orchestration-uk.credential>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-uk/src/main/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadata.java
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-uk/src/main/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadata.java b/rackspace-orchestration-uk/src/main/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadata.java
new file mode 100644
index 0000000..1307a5d
--- /dev/null
+++ b/rackspace-orchestration-uk/src/main/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadata.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.orchestration.uk;
+
+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 static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
+
+import java.net.URI;
+import java.util.Properties;
+
+import org.jclouds.openstack.heat.v1.HeatApiMetadata;
+import org.jclouds.openstack.heat.v1.config.HeatHttpApiModule;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
+import org.jclouds.providers.ProviderMetadata;
+import org.jclouds.providers.internal.BaseProviderMetadata;
+import org.jclouds.rackspace.cloudidentity.v2_0.ServiceType;
+import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule;
+import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule;
+import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes;
+
+import com.google.auto.service.AutoService;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Module;
+
+/**
+ * This is a Rackspace specific provider for Openstack Heat.
+ * Cloud Orchestration is a service that allows you to create, update and manage groups of cloud resources and their
+ * software components as a single unit and then deploy them in an automated, repeatable fashion via a template.
+ *
+ */
+@AutoService(ProviderMetadata.class)
+public class OrchestrationUKProviderMetadata extends BaseProviderMetadata {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @Override
+ public Builder toBuilder() {
+ return builder().fromProviderMetadata(this);
+ }
+
+ public OrchestrationUKProviderMetadata() {
+ this(new Builder());
+ }
+
+ protected OrchestrationUKProviderMetadata(Builder builder) {
+ super(builder);
+ }
+
+ /**
+ * @return a {@link Properties} object containing the default provider properties.
+ * This returns the credential type, service type, and configured regions.
+ */
+ public static Properties defaultProperties() {
+ Properties properties = new Properties();
+ properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS);
+ properties.setProperty(SERVICE_TYPE, ServiceType.ORCHESTRATION);
+
+ properties.setProperty(PROPERTY_REGIONS, "LON");
+ properties.setProperty(PROPERTY_REGION + ".LON." + ISO3166_CODES, "GB-SLG");
+ return properties;
+ }
+
+ public static class Builder extends BaseProviderMetadata.Builder {
+
+ protected Builder() {
+ id("rackspace-orchestration-uk")
+ .name("Rackspace Orchestration UK")
+ .apiMetadata(new HeatApiMetadata().toBuilder()
+ .identityName("${userName}")
+ .credentialName("${apiKey}")
+ .defaultEndpoint("https://lon.identity.api.rackspacecloud.com/v2.0/")
+ .documentation(
+ URI.create("http://docs.rackspace.com/orchestration/api/v1/orchestration-devguide/content/"))
+ .endpointName("Rackspace Cloud Identity service URL ending in /v2.0/")
+ .version("1")
+ .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
+ .add(CloudIdentityAuthenticationApiModule.class)
+ .add(CloudIdentityAuthenticationModule.class)
+ .add(RegionModule.class)
+ .add(HeatHttpApiModule.class)
+ .build())
+ .build())
+ .homepage(URI.create("http://www.rackspace.com/cloud/orchestration"))
+ .console(URI.create("https://mycloud.rackspace.com"))
+ .linkedServices("rackspace-autoscale-uk", "rackspace-cloudblockstorage-uk", "rackspace-clouddatabases-uk",
+ "rackspace-clouddns-uk", "rackspace-cloudidentity", "rackspace-cloudloadbalancers-uk",
+ "rackspace-cloudqueues-uk", "rackspace-cdn-uk")
+ .iso3166Codes("GB-SLG")
+ .defaultProperties(OrchestrationUKProviderMetadata.defaultProperties());
+
+ }
+
+ @Override
+ public OrchestrationUKProviderMetadata build() {
+ return new OrchestrationUKProviderMetadata(this);
+ }
+
+ @Override
+ public Builder fromProviderMetadata(ProviderMetadata in) {
+ super.fromProviderMetadata(in);
+ return this;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadataTest.java
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadataTest.java b/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadataTest.java
new file mode 100644
index 0000000..aed8611
--- /dev/null
+++ b/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKProviderMetadataTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.orchestration.uk;
+
+import org.jclouds.openstack.heat.v1.HeatApiMetadata;
+import org.jclouds.providers.internal.BaseProviderMetadataTest;
+import org.testng.annotations.Test;
+
+/**
+ * Unit tests for the {@link OrchestrationUKProviderMetadata}.
+ */
+@Test(groups = "unit", testName = "OrchestrationUKProviderMetadataTest")
+public class OrchestrationUKProviderMetadataTest extends BaseProviderMetadataTest {
+
+ public OrchestrationUKProviderMetadataTest() {
+ super(new OrchestrationUKProviderMetadata(), new HeatApiMetadata());
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKStackApiLiveTest.java
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKStackApiLiveTest.java b/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKStackApiLiveTest.java
new file mode 100644
index 0000000..18627c9
--- /dev/null
+++ b/rackspace-orchestration-uk/src/test/java/org/jclouds/rackspace/orchestration/uk/OrchestrationUKStackApiLiveTest.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.orchestration.uk;
+
+import org.jclouds.openstack.heat.v1.features.StackApiLiveTest;
+import org.testng.annotations.Test;
+
+@Test(groups = "live", testName = "OrchestrationUKStackApiLiveTest")
+public class OrchestrationUKStackApiLiveTest extends StackApiLiveTest {
+ public OrchestrationUKStackApiLiveTest() {
+ provider = "rackspace-orchestration-uk";
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-uk/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-uk/src/test/resources/logback.xml b/rackspace-orchestration-uk/src/test/resources/logback.xml
new file mode 100644
index 0000000..d7c463a
--- /dev/null
+++ b/rackspace-orchestration-uk/src/test/resources/logback.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF 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.
+
+-->
+<configuration scan="false">
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <file>target/test-data/jclouds.log</file>
+
+ <encoder>
+ <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
+ </encoder>
+ </appender>
+
+ <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender">
+ <file>target/test-data/jclouds-wire.log</file>
+
+ <encoder>
+ <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
+ </encoder>
+ </appender>
+
+ <root>
+ <level value="warn" />
+ </root>
+
+ <logger name="org.jclouds">
+ <level value="DEBUG" />
+ <appender-ref ref="FILE" />
+ </logger>
+
+ <logger name="jclouds.wire">
+ <level value="DEBUG" />
+ <appender-ref ref="WIREFILE" />
+ </logger>
+
+ <logger name="jclouds.headers">
+ <level value="DEBUG" />
+ <appender-ref ref="WIREFILE" />
+ </logger>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-us/README.md
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-us/README.md b/rackspace-orchestration-us/README.md
new file mode 100644
index 0000000..5847f82
--- /dev/null
+++ b/rackspace-orchestration-us/README.md
@@ -0,0 +1,7 @@
+Rackspace Orchestration US
+========================
+
+The Rackspace Orchestration Provider for the US region.
+
+Production ready?
+No
http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/9eea11aa/rackspace-orchestration-us/pom.xml
----------------------------------------------------------------------
diff --git a/rackspace-orchestration-us/pom.xml b/rackspace-orchestration-us/pom.xml
new file mode 100644
index 0000000..0050f72
--- /dev/null
+++ b/rackspace-orchestration-us/pom.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF 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.apache.jclouds</groupId>
+ <artifactId>jclouds-project</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <!-- TODO: when out of labs, switch to org.jclouds.provider -->
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>rackspace-orchestration-us</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <name>jclouds Rackspace Orchestration US provider</name>
+ <description>OpenStack Heat implementation targeted to Rackspace Orchestration US</description>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <!-- identity endpoint -->
+ <test.rackspace-orchestration-us.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-orchestration-us.endpoint>
+ <test.rackspace-orchestration-us.api-version>1</test.rackspace-orchestration-us.api-version>
+ <test.rackspace-orchestration-us.build-version />
+ <test.rackspace-orchestration-us.identity>${test.rackspace-us.identity}</test.rackspace-orchestration-us.identity>
+ <test.rackspace-orchestration-us.credential>${test.rackspace-us.credential}</test.rackspace-orchestration-us.credential>
+ <jclouds.osgi.export>org.jclouds.rackspace.orchestration.us*;version="${project.version}"</jclouds.osgi.export>
+ <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>openstack-heat</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>rackspace-cloudidentity</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>openstack-heat</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-core</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.driver</groupId>
+ <artifactId>jclouds-slf4j</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.auto.service</groupId>
+ <artifactId>auto-service</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ <version>1.1</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.rackspace-orchestration-us.endpoint>${test.rackspace-orchestration-us.endpoint}</test.rackspace-orchestration-us.endpoint>
+ <test.rackspace-orchestration-us.api-version>${test.rackspace-orchestration-us.api-version}</test.rackspace-orchestration-us.api-version>
+ <test.rackspace-orchestration-us.build-version>${test.rackspace-orchestration-us.build-version}</test.rackspace-orchestration-us.build-version>
+ <test.rackspace-orchestration-us.identity>${test.rackspace-orchestration-us.identity}</test.rackspace-orchestration-us.identity>
+ <test.rackspace-orchestration-us.credential>${test.rackspace-orchestration-us.credential}</test.rackspace-orchestration-us.credential>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>