Initial implementation of OpenStack Marconi and Rackspace Cloud Queues.
diff --git a/README.md b/README.md
index acf5f95..faf3c5d 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@
| Name | Type | Production Ready |
|------|------|------------------|
| openstack-glance | API | No |
+| openstack-marconi | API | No |
| openstack-neutron | API | Yes |
| openstack-swift | API | No |
| openstack-trove | API | Yes |
@@ -17,6 +18,7 @@
| rackspace-autoscale-us | Provider | No |
| rackspace-clouddatabases-uk | Provider | Yes |
| rackspace-clouddatabases-us | Provider | Yes |
+| rackspace-cloudqueues-us | Provider | No |
License
-------
diff --git a/openstack-marconi/README.md b/openstack-marconi/README.md
new file mode 100644
index 0000000..e1f4c18
--- /dev/null
+++ b/openstack-marconi/README.md
@@ -0,0 +1,7 @@
+OpenStack Marconi
+=================
+
+Marconi is a robust, web-scale message queuing service to support the distributed nature of large web applications.
+
+Production ready?
+No
diff --git a/openstack-marconi/pom.xml b/openstack-marconi/pom.xml
new file mode 100644
index 0000000..0dcfcd1
--- /dev/null
+++ b/openstack-marconi/pom.xml
@@ -0,0 +1,135 @@
+<?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>1.7.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- TODO: when out of labs, switch to org.jclouds.api -->
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>openstack-marconi</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <name>jclouds openstack-marconi api</name>
+ <description>jclouds components to access an implementation of OpenStack Marconi</description>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <!-- keystone endpoint -->
+ <test.openstack-marconi.endpoint>http://localhost:5000/v2.0/</test.openstack-marconi.endpoint>
+ <test.openstack-marconi.api-version>1</test.openstack-marconi.api-version>
+ <test.openstack-marconi.build-version />
+ <test.openstack-marconi.identity>FIXME_IDENTITY</test.openstack-marconi.identity>
+ <test.openstack-marconi.credential>FIXME_CREDENTIALS</test.openstack-marconi.credential>
+ <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
+ <jclouds.osgi.export>org.jclouds.openstack.marconi.v1*;version="${project.version}"</jclouds.osgi.export>
+ <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>apache-snapshots</id>
+ <url>https://repository.apache.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>openstack-keystone</artifactId>
+ <version>${project.parent.version}</version>
+ </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.api</groupId>
+ <artifactId>openstack-keystone</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.squareup.okhttp</groupId>
+ <artifactId>mockwebserver</artifactId>
+ <version>1.2.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.openstack-marconi.endpoint>${test.openstack-marconi.endpoint}</test.openstack-marconi.endpoint>
+ <test.openstack-marconi.api-version>${test.openstack-marconi.api-version}</test.openstack-marconi.api-version>
+ <test.openstack-marconi.build-version>${test.openstack-marconi.build-version}</test.openstack-marconi.build-version>
+ <test.openstack-marconi.identity>${test.openstack-marconi.identity}</test.openstack-marconi.identity>
+ <test.openstack-marconi.credential>${test.openstack-marconi.credential}</test.openstack-marconi.credential>
+ <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
+ <jclouds.blobstore.httpstream.url>${jclouds.blobstore.httpstream.url}</jclouds.blobstore.httpstream.url>
+ <jclouds.blobstore.httpstream.md5>${jclouds.blobstore.httpstream.md5}</jclouds.blobstore.httpstream.md5>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/MarconiApi.java b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/MarconiApi.java
new file mode 100644
index 0000000..23f643e
--- /dev/null
+++ b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/MarconiApi.java
@@ -0,0 +1,50 @@
+/*
+ * 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.marconi.v1;
+
+import com.google.inject.Provides;
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.location.Region;
+import org.jclouds.location.Zone;
+import org.jclouds.location.functions.ZoneToEndpoint;
+import org.jclouds.openstack.marconi.v1.features.QueueApi;
+import org.jclouds.rest.annotations.Delegate;
+import org.jclouds.rest.annotations.EndpointParam;
+
+import java.io.Closeable;
+import java.util.Set;
+
+/**
+ * Marconi is a robust, web-scale message queuing service to support the distributed nature of large web applications.
+ *
+ * @author Everett Toews
+ */
+public interface MarconiApi extends Closeable {
+ /**
+ * @return The Zone codes configured
+ */
+ @Provides
+ @Zone
+ Set<String> getConfiguredZones();
+
+ /**
+ * Provides access to Queue features.
+ */
+ @Delegate
+ QueueApi getQueueApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+}
diff --git a/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/MarconiApiMetadata.java b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/MarconiApiMetadata.java
new file mode 100644
index 0000000..bee1aba
--- /dev/null
+++ b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/MarconiApiMetadata.java
@@ -0,0 +1,93 @@
+/*
+ * 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.marconi.v1;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Module;
+import org.jclouds.openstack.keystone.v2_0.config.AuthenticationApiModule;
+import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule;
+import org.jclouds.openstack.marconi.v1.config.MarconiHttpApiModule;
+import org.jclouds.openstack.marconi.v1.config.MarconiTypeAdapters;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.rest.internal.BaseHttpApiMetadata;
+
+import java.net.URI;
+import java.util.Properties;
+
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
+
+/**
+ * Implementation of {@link org.jclouds.apis.ApiMetadata} for Marconi 1.0 API
+ *
+ * @author Everett Toews
+ */
+public class MarconiApiMetadata extends BaseHttpApiMetadata<MarconiApi> {
+
+ @Override
+ public Builder toBuilder() {
+ return new Builder().fromApiMetadata(this);
+ }
+
+ public MarconiApiMetadata() {
+ this(new Builder());
+ }
+
+ protected MarconiApiMetadata(Builder builder) {
+ super(builder);
+ }
+
+ public static Properties defaultProperties() {
+ Properties properties = BaseHttpApiMetadata.defaultProperties();
+ properties.setProperty(SERVICE_TYPE, ServiceType.QUEUES);
+ properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
+ return properties;
+ }
+
+ public static class Builder extends BaseHttpApiMetadata.Builder<MarconiApi, Builder> {
+
+ protected Builder() {
+ id("openstack-marconi")
+ .name("OpenStack Marconi Havana API")
+ .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
+ .credentialName("${password}")
+ .documentation(URI.create("https://wiki.openstack.org/wiki/Marconi"))
+ .version("1.0")
+ .endpointName("Keystone base url ending in /v2.0/")
+ .defaultEndpoint("http://localhost:5000/v2.0/")
+ .defaultProperties(MarconiApiMetadata.defaultProperties())
+ .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
+ .add(AuthenticationApiModule.class)
+ .add(KeystoneAuthenticationModule.class)
+ .add(ZoneModule.class)
+ .add(MarconiTypeAdapters.class)
+ .add(MarconiHttpApiModule.class).build());
+ }
+
+ @Override
+ public MarconiApiMetadata build() {
+ return new MarconiApiMetadata(this);
+ }
+
+ @Override
+ protected Builder self() {
+ return this;
+ }
+ }
+}
diff --git a/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/config/MarconiHttpApiModule.java b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/config/MarconiHttpApiModule.java
new file mode 100644
index 0000000..1e18d0e
--- /dev/null
+++ b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/config/MarconiHttpApiModule.java
@@ -0,0 +1,40 @@
+/*
+ * 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.marconi.v1.config;
+
+import org.jclouds.http.HttpErrorHandler;
+import org.jclouds.http.annotation.ClientError;
+import org.jclouds.http.annotation.Redirection;
+import org.jclouds.http.annotation.ServerError;
+import org.jclouds.openstack.marconi.v1.MarconiApi;
+import org.jclouds.openstack.marconi.v1.handlers.MarconiErrorHandler;
+import org.jclouds.rest.ConfiguresHttpApi;
+import org.jclouds.rest.config.HttpApiModule;
+
+@ConfiguresHttpApi
+public class MarconiHttpApiModule extends HttpApiModule<MarconiApi> {
+
+ public MarconiHttpApiModule() {
+ }
+
+ @Override
+ protected void bindErrorHandlers() {
+ bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(MarconiErrorHandler.class);
+ bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(MarconiErrorHandler.class);
+ bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(MarconiErrorHandler.class);
+ }
+}
diff --git a/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/config/MarconiTypeAdapters.java b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/config/MarconiTypeAdapters.java
new file mode 100644
index 0000000..d12acc3
--- /dev/null
+++ b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/config/MarconiTypeAdapters.java
@@ -0,0 +1,29 @@
+/*
+ * 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.marconi.v1.config;
+
+import com.google.inject.AbstractModule;
+import org.jclouds.json.config.GsonModule.DateAdapter;
+import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
+
+public class MarconiTypeAdapters extends AbstractModule {
+
+ @Override
+ protected void configure() {
+ bind(DateAdapter.class).to(Iso8601DateAdapter.class);
+ }
+}
diff --git a/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/features/QueueApi.java b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/features/QueueApi.java
new file mode 100644
index 0000000..e620002
--- /dev/null
+++ b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/features/QueueApi.java
@@ -0,0 +1,52 @@
+/*
+ * 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.marconi.v1.features;
+
+import org.jclouds.Fallbacks;
+import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SkipEncoding;
+
+import javax.inject.Named;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * Provides access to Queues via their REST API.
+ *
+ * @author Everett Toews
+ */
+@SkipEncoding({'/', '='})
+@RequestFilters(AuthenticateRequest.class)
+public interface QueueApi {
+ /**
+ * Creates a new Queue
+ *
+ * @param name Name of the Queue. The name must not exceed 64 bytes in length, and it is limited to US-ASCII
+ * letters, digits, underscores, and hyphens.
+ */
+ @Named("queue:create")
+ @PUT
+ @Path("queues/{name}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Fallback(Fallbacks.FalseOnNotFoundOr404.class)
+ boolean create(@PathParam("name") String name);
+}
diff --git a/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/handlers/MarconiErrorHandler.java b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/handlers/MarconiErrorHandler.java
new file mode 100644
index 0000000..dd6c603
--- /dev/null
+++ b/openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/handlers/MarconiErrorHandler.java
@@ -0,0 +1,48 @@
+/*
+ * 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.marconi.v1.handlers;
+
+import org.jclouds.http.HttpCommand;
+import org.jclouds.http.HttpErrorHandler;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.http.HttpResponseException;
+import org.jclouds.rest.AuthorizationException;
+
+import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
+
+public class MarconiErrorHandler implements HttpErrorHandler {
+
+ public void handleError(HttpCommand command, HttpResponse response) {
+ // it is important to always read fully and close streams
+ byte[] data = closeClientButKeepContentStream(response);
+ String message = (data != null) ? new String(data) : null;
+
+ Exception exception = (message != null) ?
+ new HttpResponseException(command, response, message) :
+ new HttpResponseException(command, response);
+
+ switch (response.getStatusCode()) {
+ case 401:
+ exception = new AuthorizationException(exception.getMessage(), exception);
+ break;
+ case 409:
+ exception = new IllegalStateException(exception.getMessage(), exception);
+ break;
+ }
+ command.setException(exception);
+ }
+}
diff --git a/openstack-marconi/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/openstack-marconi/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
new file mode 100644
index 0000000..f355790
--- /dev/null
+++ b/openstack-marconi/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+org.jclouds.openstack.marconi.v1.MarconiApiMetadata
diff --git a/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiLiveTest.java b/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiLiveTest.java
new file mode 100644
index 0000000..86f1f0d
--- /dev/null
+++ b/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiLiveTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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.marconi.v1.features;
+
+import org.jclouds.openstack.marconi.v1.internal.BaseMarconiApiLiveTest;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+
+@Test(groups = "live", testName = "QueueApiLiveTest")
+public class QueueApiLiveTest extends BaseMarconiApiLiveTest {
+
+ public void create() throws Exception {
+ for (String zoneId : api.getConfiguredZones()) {
+ QueueApi queueApi = api.getQueueApiForZone(zoneId);
+ boolean success = queueApi.create("jclouds-test");
+
+ assertTrue(success);
+ }
+ }
+}
diff --git a/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiMockTest.java b/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiMockTest.java
new file mode 100644
index 0000000..db0caf0
--- /dev/null
+++ b/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiMockTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.marconi.v1.features;
+
+import com.squareup.okhttp.mockwebserver.MockResponse;
+import com.squareup.okhttp.mockwebserver.MockWebServer;
+import org.jclouds.openstack.marconi.v1.MarconiApi;
+import org.jclouds.openstack.v2_0.internal.BaseOpenStackMockTest;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * @author Everett Toews
+ */
+@Test
+public class QueueApiMockTest extends BaseOpenStackMockTest<MarconiApi> {
+
+ public void createQueue() throws Exception {
+ MockWebServer server = mockOpenStackServer();
+ server.enqueue(new MockResponse().setBody(accessRackspace));
+ server.enqueue(new MockResponse().setResponseCode(204));
+
+ try {
+ MarconiApi api = api(server.getUrl("/").toString(), "openstack-marconi");
+ QueueApi queueApi = api.getQueueApiForZone("DFW");
+ boolean success = queueApi.create("jclouds-test");
+
+ assertTrue(success);
+
+ assertEquals(server.getRequestCount(), 2);
+ assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
+ assertEquals(server.takeRequest().getRequestLine(), "PUT /v1/123123/queues/jclouds-test HTTP/1.1");
+ }
+ finally {
+ server.shutdown();
+ }
+ }
+}
diff --git a/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/internal/BaseMarconiApiLiveTest.java b/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/internal/BaseMarconiApiLiveTest.java
new file mode 100644
index 0000000..e34ab23
--- /dev/null
+++ b/openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/internal/BaseMarconiApiLiveTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.marconi.v1.internal;
+
+import org.jclouds.apis.BaseApiLiveTest;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
+import org.jclouds.openstack.marconi.v1.MarconiApi;
+
+import java.util.Properties;
+
+public class BaseMarconiApiLiveTest extends BaseApiLiveTest<MarconiApi> {
+
+ public BaseMarconiApiLiveTest() {
+ provider = "openstack-marconi";
+ }
+
+ @Override
+ protected Properties setupProperties() {
+ Properties props = super.setupProperties();
+ setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
+ return props;
+ }
+}
diff --git a/openstack-marconi/src/test/resources/logback.xml b/openstack-marconi/src/test/resources/logback.xml
new file mode 100644
index 0000000..ce891f1
--- /dev/null
+++ b/openstack-marconi/src/test/resources/logback.xml
@@ -0,0 +1,71 @@
+<?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>
+
+ <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
+ <file>target/test-data/jclouds-blobstore.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>
+
+ <logger name="jclouds.blobstore">
+ <level value="DEBUG" />
+ <appender-ref ref="BLOBSTOREFILE" />
+ </logger>
+
+</configuration>
diff --git a/rackspace-cloudqueues-us/README.md b/rackspace-cloudqueues-us/README.md
new file mode 100644
index 0000000..5795142
--- /dev/null
+++ b/rackspace-cloudqueues-us/README.md
@@ -0,0 +1,7 @@
+Rackspace Cloud Queues US
+=========================
+
+The Rackspace deployment of OpenStack Marconi, the Queues as a Service.
+
+Production ready?
+No
diff --git a/rackspace-cloudqueues-us/pom.xml b/rackspace-cloudqueues-us/pom.xml
new file mode 100644
index 0000000..42fc804
--- /dev/null
+++ b/rackspace-cloudqueues-us/pom.xml
@@ -0,0 +1,164 @@
+<?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>1.7.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- TODO: when out of labs, switch to org.jclouds.provider; update dependencies when Marconi is moved to jclouds -->
+
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>rackspace-cloudqueues-us</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <name>jclouds Rackspace Cloud Queues US provider</name>
+ <description>OpenStack Marconi implementation targeted to Rackspace Cloud Queues US</description>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <test.rackspace-cloudqueues-us.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-cloudqueues-us.endpoint>
+ <test.rackspace-cloudqueues-us.api-version>1</test.rackspace-cloudqueues-us.api-version>
+ <test.rackspace-cloudqueues-us.build-version />
+ <test.rackspace-cloudqueues-us.identity>${test.rackspace-us.identity}</test.rackspace-cloudqueues-us.identity>
+ <test.rackspace-cloudqueues-us.credential>${test.rackspace-us.credential}</test.rackspace-cloudqueues-us.credential>
+ <test.rackspace-cloudqueues-us.template />
+ <jclouds.osgi.export>org.jclouds.rackspace.cloudqueues.us*;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>
+
+ <repositories>
+ <repository>
+ <id>apache-snapshots</id>
+ <url>https://repository.apache.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-core</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>openstack-marconi</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>openstack-keystone</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>rackspace-cloudidentity</artifactId>
+ <version>${project.parent.version}</version>
+ </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.labs</groupId>
+ <artifactId>openstack-marconi</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>openstack-keystone</artifactId>
+ <version>${project.parent.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>rackspace-cloudidentity</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>
+ </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>
+ <forkCount>5</forkCount>
+ <reuseForks>true</reuseForks>
+ <parallel>classes</parallel>
+ <systemPropertyVariables>
+ <test.rackspace-cloudqueues-us.endpoint>${test.rackspace-cloudqueues-us.endpoint}</test.rackspace-cloudqueues-us.endpoint>
+ <test.rackspace-cloudqueues-us.api-version>${test.rackspace-cloudqueues-us.api-version}</test.rackspace-cloudqueues-us.api-version>
+ <test.rackspace-cloudqueues-us.build-version>${test.rackspace-cloudqueues-us.build-version}</test.rackspace-cloudqueues-us.build-version>
+ <test.rackspace-cloudqueues-us.identity>${test.rackspace-cloudqueues-us.identity}</test.rackspace-cloudqueues-us.identity>
+ <test.rackspace-cloudqueues-us.credential>${test.rackspace-cloudqueues-us.credential}</test.rackspace-cloudqueues-us.credential>
+ <test.rackspace-cloudqueues-us.template>${test.rackspace-cloudqueues-us.template}</test.rackspace-cloudqueues-us.template>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/rackspace-cloudqueues-us/src/main/java/org/jclouds/rackspace/cloudqueues/us/CloudQueuesUSProviderMetadata.java b/rackspace-cloudqueues-us/src/main/java/org/jclouds/rackspace/cloudqueues/us/CloudQueuesUSProviderMetadata.java
new file mode 100644
index 0000000..95d8c0c
--- /dev/null
+++ b/rackspace-cloudqueues-us/src/main/java/org/jclouds/rackspace/cloudqueues/us/CloudQueuesUSProviderMetadata.java
@@ -0,0 +1,115 @@
+/*
+ * 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.cloudqueues.us;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Module;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule;
+import org.jclouds.openstack.marconi.v1.MarconiApiMetadata;
+import org.jclouds.openstack.marconi.v1.config.MarconiHttpApiModule;
+import org.jclouds.openstack.marconi.v1.config.MarconiTypeAdapters;
+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 java.net.URI;
+import java.util.Properties;
+
+import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES;
+import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONE;
+import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONES;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
+
+/**
+ * Implementation of Rackspace Cloud Queues.
+ *
+ * @author Everett Toews
+ */
+public class CloudQueuesUSProviderMetadata extends BaseProviderMetadata {
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @Override
+ public Builder toBuilder() {
+ return builder().fromProviderMetadata(this);
+ }
+
+ public CloudQueuesUSProviderMetadata() {
+ super(builder());
+ }
+
+ public CloudQueuesUSProviderMetadata(Builder builder) {
+ super(builder);
+ }
+
+ public static Properties defaultProperties() {
+ Properties properties = new Properties();
+ properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS);
+ properties.setProperty(SERVICE_TYPE, ServiceType.QUEUES);
+ properties.setProperty(PROPERTY_ZONES, "ORD,DFW,IAD,SYD,HKG");
+ properties.setProperty(PROPERTY_ZONE + ".ORD." + ISO3166_CODES, "US-IL");
+ properties.setProperty(PROPERTY_ZONE + ".DFW." + ISO3166_CODES, "US-TX");
+ properties.setProperty(PROPERTY_ZONE + ".IAD." + ISO3166_CODES, "US-VA");
+ properties.setProperty(PROPERTY_ZONE + ".SYD." + ISO3166_CODES, "AU-NSW");
+ properties.setProperty(PROPERTY_ZONE + ".HKG." + ISO3166_CODES, "HK");
+ return properties;
+ }
+
+ public static class Builder extends BaseProviderMetadata.Builder {
+
+ protected Builder(){
+ id("rackspace-cloudqueues-us")
+ .name("Rackspace Cloud Queues US")
+ .apiMetadata(new MarconiApiMetadata().toBuilder()
+ .identityName("${userName}")
+ .credentialName("${apiKey}")
+ .defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
+ .endpointName("identity service url ending in /v2.0/")
+ .documentation(URI.create("http://docs.rackspace.com/queues/api/v1.0/cq-devguide/content/overview.html"))
+ .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
+ .add(CloudIdentityAuthenticationApiModule.class)
+ .add(CloudIdentityAuthenticationModule.class)
+ .add(ZoneModule.class)
+ .add(MarconiTypeAdapters.class)
+ .add(MarconiHttpApiModule.class).build())
+ .build())
+ .homepage(URI.create("http://www.rackspace.com/cloud/queues/"))
+ .console(URI.create("https://mycloud.rackspace.com"))
+ .linkedServices("rackspace-cloudservers-us", "cloudfiles-us")
+ .iso3166Codes("US-IL", "US-TX")
+ .endpoint("https://identity.api.rackspacecloud.com/v2.0/")
+ .defaultProperties(CloudQueuesUSProviderMetadata.defaultProperties());
+ }
+
+ @Override
+ public CloudQueuesUSProviderMetadata build() {
+ return new CloudQueuesUSProviderMetadata(this);
+ }
+
+ @Override
+ public Builder fromProviderMetadata(ProviderMetadata in) {
+ super.fromProviderMetadata(in);
+ return this;
+ }
+ }
+}
diff --git a/rackspace-cloudqueues-us/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/rackspace-cloudqueues-us/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
new file mode 100644
index 0000000..019715f
--- /dev/null
+++ b/rackspace-cloudqueues-us/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
@@ -0,0 +1 @@
+org.jclouds.rackspace.cloudqueues.us.CloudQueuesUSProviderMetadata
diff --git a/rackspace-cloudqueues-us/src/test/java/org/jclouds/rackspace/cloudqueues/us/CloudQueuesUSQueueApiLiveTest.java b/rackspace-cloudqueues-us/src/test/java/org/jclouds/rackspace/cloudqueues/us/CloudQueuesUSQueueApiLiveTest.java
new file mode 100644
index 0000000..bfedab7
--- /dev/null
+++ b/rackspace-cloudqueues-us/src/test/java/org/jclouds/rackspace/cloudqueues/us/CloudQueuesUSQueueApiLiveTest.java
@@ -0,0 +1,30 @@
+/*
+ * 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.cloudqueues.us;
+
+import org.jclouds.openstack.marconi.v1.features.QueueApiLiveTest;
+import org.testng.annotations.Test;
+
+/**
+ * @author Everett Toews
+ */
+@Test(groups = "live", testName = "CloudQueuesUSQueueApiLiveTest")
+public class CloudQueuesUSQueueApiLiveTest extends QueueApiLiveTest {
+ public CloudQueuesUSQueueApiLiveTest() {
+ provider = "rackspace-cloudqueues-us";
+ }
+}
diff --git a/rackspace-cloudqueues-us/src/test/resources/logback.xml b/rackspace-cloudqueues-us/src/test/resources/logback.xml
new file mode 100644
index 0000000..6559c23
--- /dev/null
+++ b/rackspace-cloudqueues-us/src/test/resources/logback.xml
@@ -0,0 +1,69 @@
+<?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>
+
+ <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
+ <file>target/test-data/jclouds-blobstore.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>
+
+ <logger name="jclouds.blobstore">
+ <level value="DEBUG" />
+ <appender-ref ref="BLOBSTOREFILE" />
+ </logger>
+
+</configuration>