You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2013/08/02 23:30:22 UTC
[1/6] Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
Updated Branches:
refs/heads/remove-openstack-1.6.x [created] 0736d2dd7
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiLiveTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiLiveTest.java
deleted file mode 100644
index 5f09d97..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiLiveTest.java
+++ /dev/null
@@ -1,41 +0,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.
- */
-package org.jclouds.openstack.swift.v1.internal;
-
-import java.util.Properties;
-import org.jclouds.apis.BaseApiLiveTest;
-import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
-import org.jclouds.openstack.swift.v1.SwiftApi;
-
-/**
- * Tests behavior of {@code SwiftApi}
- *
- * @author Adrian Cole
- */
-public class BaseSwiftApiLiveTest extends BaseApiLiveTest<SwiftApi> {
-
- public BaseSwiftApiLiveTest() {
- provider = "openstack-swift";
- }
-
- @Override
- protected Properties setupProperties() {
- Properties props = super.setupProperties();
- setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
- return props;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftExpectTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftExpectTest.java
deleted file mode 100644
index 1d0c59a..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftExpectTest.java
+++ /dev/null
@@ -1,50 +0,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.
- */
-package org.jclouds.openstack.swift.v1.internal;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-/**
- * Base class for writing Swift Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseSwiftExpectTest<T> extends BaseRestApiExpectTest<T> {
- protected HttpRequest keystoneAuthWithUsernameAndPassword;
- protected HttpRequest keystoneAuthWithAccessKeyAndSecretKey;
- protected String authToken;
- protected HttpResponse responseWithKeystoneAccess;
- protected HttpRequest extensionsOfSwiftRequest;
- protected HttpResponse extensionsOfSwiftResponse;
- protected HttpResponse unmatchedExtensionsOfSwiftResponse;
-
- public BaseSwiftExpectTest() {
- provider = "openstack-swift";
- keystoneAuthWithUsernameAndPassword = KeystoneFixture.INSTANCE.initialAuthWithUsernameAndPasswordAndTenantName(identity,
- credential);
- keystoneAuthWithAccessKeyAndSecretKey = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantName(identity,
- credential);
-
- authToken = KeystoneFixture.INSTANCE.getAuthToken();
- responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess();
- // now, createContext arg will need tenant prefix
- identity = KeystoneFixture.INSTANCE.getTenantName() + ":" + identity;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/options/ListContainersOptionsTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/options/ListContainersOptionsTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/options/ListContainersOptionsTest.java
deleted file mode 100644
index 4f4b74e..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/options/ListContainersOptionsTest.java
+++ /dev/null
@@ -1,94 +0,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.
- */
-package org.jclouds.openstack.swift.v1.options;
-
-import static org.jclouds.openstack.swift.v1.options.ListContainersOptions.Builder.limit;
-import static org.jclouds.openstack.swift.v1.options.ListContainersOptions.Builder.marker;
-import static org.testng.Assert.assertEquals;
-
-import com.google.common.collect.ImmutableList;
-
-import org.jclouds.http.options.HttpRequestOptions;
-import org.testng.annotations.Test;
-
-/**
- * Tests possible uses of ListContainerOptions and ListContainerOptions.Builder.*
- *
- * @author Adrian Cole
- */
-@Test(testName = "ListContainersOptionsTest")
-public class ListContainersOptionsTest {
-
- @Test
- public void testAssignability() {
- assert HttpRequestOptions.class.isAssignableFrom(ListContainersOptions.class);
- assert !String.class.isAssignableFrom(ListContainersOptions.class);
- }
- @Test
- public void testNoOptionsQueryString() {
- HttpRequestOptions options = new ListContainersOptions();
- assertEquals(options.buildQueryParameters().size(), 0);
- }
-
- @Test
- public void testMarker() {
- ListContainersOptions options = new ListContainersOptions();
- options.marker("test");
- assertEquals(options.buildQueryParameters().get("marker"), ImmutableList.of("test"));
- }
-
- @Test
- public void testNullMarker() {
- ListContainersOptions options = new ListContainersOptions();
- assertEquals(options.buildQueryParameters().get("marker"), ImmutableList.of());
- }
-
- @Test
- public void testMarkerStatic() {
- ListContainersOptions options = marker("test");
- assertEquals(options.buildQueryParameters().get("marker"), ImmutableList.of("test"));
- }
-
- @Test(expectedExceptions = NullPointerException.class)
- public void testMarkerNPE() {
- marker(null);
- }
-
- @Test
- public void testLimit() {
- ListContainersOptions options = new ListContainersOptions();
- options.limit(1000);
- assertEquals(options.buildQueryParameters().get("limit"), ImmutableList.of("1000"));
- }
-
- @Test
- public void testNullLimit() {
- ListContainersOptions options = new ListContainersOptions();
- assertEquals(options.buildQueryParameters().get("limit"), ImmutableList.of());
- }
-
- @Test
- public void testLimitStatic() {
- ListContainersOptions options = limit(1000);
- assertEquals(options.buildQueryParameters().get("limit"), ImmutableList.of("1000"));
- }
-
- @Test(expectedExceptions = IllegalStateException.class)
- public void testLimitNegative() {
- limit(-1);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/parse/ParseContainerListTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/parse/ParseContainerListTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/parse/ParseContainerListTest.java
deleted file mode 100644
index fac9c5d..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/parse/ParseContainerListTest.java
+++ /dev/null
@@ -1,57 +0,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.
- */
-package org.jclouds.openstack.swift.v1.parse;
-
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseSetParserTest;
-import org.jclouds.openstack.swift.v1.domain.Container;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseContainerListTest")
-public class ParseContainerListTest extends BaseSetParserTest<Container> {
-
- @Override
- public String resource() {
- return "/container_list.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public Set<Container> expected() {
- return ImmutableSet
- .of(Container.builder()
- .name("test_container_1")
- .count(2)
- .bytes(78)
- .build(),
- Container.builder()
- .name("test_container_2")
- .count(1)
- .bytes(17)
- .build());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/resources/container_list.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/resources/container_list.json b/openstack/openstack-swift/src/test/resources/container_list.json
deleted file mode 100644
index f7d9b9b..0000000
--- a/openstack/openstack-swift/src/test/resources/container_list.json
+++ /dev/null
@@ -1,4 +0,0 @@
-[
- {"name":"test_container_1", "count":2, "bytes":78},
- {"name":"test_container_2", "count":1, "bytes":17}
-]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/resources/logback.xml b/openstack/openstack-swift/src/test/resources/logback.xml
deleted file mode 100644
index a4f81d3..0000000
--- a/openstack/openstack-swift/src/test/resources/logback.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<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>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/pom.xml b/openstack/pom.xml
deleted file mode 100644
index 0a0dcdf..0000000
--- a/openstack/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs</artifactId>
- <version>1.6.2-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jclouds-labs-openstack</artifactId>
- <packaging>pom</packaging>
- <name>jclouds labs openstack</name>
- <modules>
- <!--<module>openstack-atlas</module>-->
- <!--<module>openstack-cinder-v2</module>-->
- <module>openstack-glance</module>
- <!--<module>openstack-keystone-v3</module>-->
- <!--<module>openstack-moniker</module>-->
- <module>openstack-quantum</module>
- <module>openstack-reddwarf</module>
- <module>openstack-swift</module>
- </modules>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1911e68..6bfd6c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,7 +83,6 @@
<module>fgcp-de</module>
<module>abiquo</module>
<module>oauth</module>
- <module>openstack</module>
<module>jclouds-representations</module>
<module>jclouds-management</module>
</modules>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/rackspace-clouddns-uk/pom.xml
----------------------------------------------------------------------
diff --git a/rackspace-clouddns-uk/pom.xml b/rackspace-clouddns-uk/pom.xml
deleted file mode 100644
index 614a898..0000000
--- a/rackspace-clouddns-uk/pom.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns-uk</artifactId>
- <name>jclouds Rackspace Next Generation Cloud DNS UK provider</name>
- <description>Rackspace Next Generation Cloud DNS UK</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.rackspace-clouddns-uk.endpoint>https://lon.identity.api.rackspacecloud.com/v2.0/</test.rackspace-clouddns-uk.endpoint>
- <test.rackspace-clouddns-uk.api-version>1.0</test.rackspace-clouddns-uk.api-version>
- <test.rackspace-clouddns-uk.build-version />
- <test.rackspace-clouddns-uk.identity>${test.rackspace-uk.identity}</test.rackspace-clouddns-uk.identity>
- <test.rackspace-clouddns-uk.credential>${test.rackspace-uk.credential}</test.rackspace-clouddns-uk.credential>
- <test.rackspace-clouddns-uk.template />
- <jclouds.osgi.export>org.jclouds.rackspace.clouddns.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>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>rackspace-cloudidentity</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>rackspace-cloudidentity</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>1.6.1-SNAPSHOT</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>
- <threadCount>1</threadCount>
- <systemPropertyVariables>
- <test.rackspace-clouddns-uk.endpoint>${test.rackspace-clouddns-uk.endpoint}</test.rackspace-clouddns-uk.endpoint>
- <test.rackspace-clouddns-uk.api-version>${test.rackspace-clouddns-uk.api-version}</test.rackspace-clouddns-uk.api-version>
- <test.rackspace-clouddns-uk.build-version>${test.rackspace-clouddns-uk.build-version}</test.rackspace-clouddns-uk.build-version>
- <test.rackspace-clouddns-uk.identity>${test.rackspace-clouddns-uk.identity}</test.rackspace-clouddns-uk.identity>
- <test.rackspace-clouddns-uk.credential>${test.rackspace-clouddns-uk.credential}</test.rackspace-clouddns-uk.credential>
- <test.rackspace-clouddns-uk.template>${test.rackspace-clouddns-uk.template}</test.rackspace-clouddns-uk.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/rackspace-clouddns-us/pom.xml
----------------------------------------------------------------------
diff --git a/rackspace-clouddns-us/pom.xml b/rackspace-clouddns-us/pom.xml
deleted file mode 100644
index b71572b..0000000
--- a/rackspace-clouddns-us/pom.xml
+++ /dev/null
@@ -1,165 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </parent>
-
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns-us</artifactId>
- <name>jclouds Rackspace Next Generation Cloud DNS US provider</name>
- <description>Rackspace Next Generation Cloud DNS US</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.rackspace-clouddns-us.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-clouddns-us.endpoint>
- <test.rackspace-clouddns-us.api-version>1.0</test.rackspace-clouddns-us.api-version>
- <test.rackspace-clouddns-us.build-version />
- <test.rackspace-clouddns-us.identity>${test.rackspace-us.identity}</test.rackspace-clouddns-us.identity>
- <test.rackspace-clouddns-us.credential>${test.rackspace-us.credential}</test.rackspace-clouddns-us.credential>
- <test.rackspace-clouddns-us.template />
- <jclouds.osgi.export>org.jclouds.rackspace.clouddns.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>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>rackspace-cloudidentity</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-nova</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>rackspace-cloudidentity</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>rackspace-cloudservers-us</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>1.6.1-SNAPSHOT</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>
- <threadCount>1</threadCount>
- <systemPropertyVariables>
- <test.rackspace-clouddns-us.endpoint>${test.rackspace-clouddns-us.endpoint}</test.rackspace-clouddns-us.endpoint>
- <test.rackspace-clouddns-us.api-version>${test.rackspace-clouddns-us.api-version}</test.rackspace-clouddns-us.api-version>
- <test.rackspace-clouddns-us.build-version>${test.rackspace-clouddns-us.build-version}</test.rackspace-clouddns-us.build-version>
- <test.rackspace-clouddns-us.identity>${test.rackspace-clouddns-us.identity}</test.rackspace-clouddns-us.identity>
- <test.rackspace-clouddns-us.credential>${test.rackspace-clouddns-us.credential}</test.rackspace-clouddns-us.credential>
- <test.rackspace-clouddns-us.template>${test.rackspace-clouddns-us.template}</test.rackspace-clouddns-us.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/rackspace-clouddns/pom.xml
----------------------------------------------------------------------
diff --git a/rackspace-clouddns/pom.xml b/rackspace-clouddns/pom.xml
deleted file mode 100644
index 0677371..0000000
--- a/rackspace-clouddns/pom.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.provider -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>rackspace-clouddns</artifactId>
- <name>jclouds rackspace clouddns api</name>
- <description>jclouds components for Rackspace Cloud DNS</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.rackspace-clouddns.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-clouddns.endpoint>
- <test.rackspace-clouddns.api-version>1.0</test.rackspace-clouddns.api-version>
- <test.rackspace-clouddns.build-version />
- <test.rackspace-clouddns.identity>${test.rackspace-us.identity}</test.rackspace-clouddns.identity>
- <test.rackspace-clouddns.credential>${test.rackspace-us.credential}</test.rackspace-clouddns.credential>
-
- <jclouds.osgi.export>org.jclouds.rackspace.clouddns.v1*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.rest.internal;version="${project.version}",
- org.jclouds*;version="${project.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>rackspace-cloudidentity</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-nova</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>rackspace-cloudidentity</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>rackspace-cloudservers-us</artifactId>
- <version>1.6.1-SNAPSHOT</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>1.6.1-SNAPSHOT</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>
- <!-- TODO: remove when multiple jobs/session are supported -->
- <threadCount>1</threadCount>
- <systemPropertyVariables>
- <test.rackspace-clouddns.endpoint>${test.rackspace-clouddns.endpoint}</test.rackspace-clouddns.endpoint>
- <test.rackspace-clouddns.api-version>${test.rackspace-clouddns.api-version}</test.rackspace-clouddns.api-version>
- <test.rackspace-clouddns.build-version>${test.rackspace-clouddns.build-version}</test.rackspace-clouddns.build-version>
- <test.rackspace-clouddns.identity>${test.rackspace-clouddns.identity}</test.rackspace-clouddns.identity>
- <test.rackspace-clouddns.credential>${test.rackspace-clouddns.credential}</test.rackspace-clouddns.credential>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
[2/6] Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/resources/access_rax_us.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/resources/access_rax_us.json b/openstack/openstack-reddwarf/src/test/resources/access_rax_us.json
deleted file mode 100644
index 6f71c9e..0000000
--- a/openstack/openstack-reddwarf/src/test/resources/access_rax_us.json
+++ /dev/null
@@ -1,163 +0,0 @@
-{
- "access": {
- "token": {
- "id": "myToken",
- "expires": "2012-09-30T17:15:32.000-05:00",
- "tenant": {
- "id": "717071",
- "name": "717071"
- }
- },
- "serviceCatalog": [
- {
- "endpoints": [
- {
- "tenantId": "717071",
- "publicURL": "https://dns.api.rackspacecloud.com/v1.0/717071"
- }
- ],
- "name": "cloudDNS",
- "type": "rax:dns"
- },
- {
- "endpoints": [
- {
- "tenantId": "717071",
- "publicURL": "https://monitoring.api.rackspacecloud.com/v1.0/717071"
- }
- ],
- "name": "cloudMonitoring",
- "type": "rax:monitor"
- },
- {
- "endpoints": [
- {
- "region": "DFW",
- "tenantId": "717071",
- "publicURL": "https://dfw.servers.api.rackspacecloud.com/v2/717071",
- "versionInfo": "https://dfw.servers.api.rackspacecloud.com/v2",
- "versionList": "https://dfw.servers.api.rackspacecloud.com/",
- "versionId": "2"
- },
- {
- "region": "ORD",
- "tenantId": "717071",
- "publicURL": "https://ord.servers.api.rackspacecloud.com/v2/717071",
- "versionInfo": "https://ord.servers.api.rackspacecloud.com/v2",
- "versionList": "https://ord.servers.api.rackspacecloud.com/",
- "versionId": "2"
- }
- ],
- "name": "cloudServersOpenStack",
- "type": "compute"
- },
- {
- "endpoints": [
- {
- "region": "ORD",
- "tenantId": "717071",
- "publicURL": "https://ord.loadbalancers.api.rackspacecloud.com/v1.0/717071"
- },
- {
- "region": "DFW",
- "tenantId": "717071",
- "publicURL": "https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/717071"
- }
- ],
- "name": "cloudLoadBalancers",
- "type": "rax:load-balancer"
- },
- {
- "endpoints": [
- {
- "region": "DFW",
- "tenantId": "717071",
- "publicURL": "https://dfw.databases.api.rackspacecloud.com/v1.0/717071"
- },
- {
- "region": "ORD",
- "tenantId": "717071",
- "publicURL": "https://ord.databases.api.rackspacecloud.com/v1.0/717071"
- }
- ],
- "name": "cloudDatabases",
- "type": "rax:database"
- },
- {
- "endpoints": [
- {
- "region": "DFW",
- "tenantId": "MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9",
- "publicURL": "https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9",
- "internalURL": "https://snet-storage101.dfw1.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9"
- },
- {
- "region": "ORD",
- "tenantId": "MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9",
- "publicURL": "https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9",
- "internalURL": "https://snet-storage101.ord1.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9"
- }
- ],
- "name": "cloudFiles",
- "type": "object-store"
- },
- {
- "endpoints": [
- {
- "region": "DFW",
- "tenantId": "MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9",
- "publicURL": "https://cdn1.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9"
- },
- {
- "region": "ORD",
- "tenantId": "MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9",
- "publicURL": "https://cdn2.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9"
- }
- ],
- "name": "cloudFilesCDN",
- "type": "rax:object-cdn"
- },
- {
- "endpoints": [
- {
- "tenantId": "717071",
- "publicURL": "https://servers.api.rackspacecloud.com/v1.0/717071",
- "versionInfo": "https://servers.api.rackspacecloud.com/v1.0",
- "versionList": "https://servers.api.rackspacecloud.com/",
- "versionId": "1.0"
- }
- ],
- "name": "cloudServers",
- "type": "compute"
- },
- {
- "endpoints": [
- {
- "publicURL": "https://ord.blockstorage.api.rackspacecloud.com/v1/717071",
- "tenantId": "717071",
- "region": "ORD"
- },
- {
- "region": "DFW",
- "tenantId": "717071",
- "publicURL": "https://dfw.blockstorage.api.rackspacecloud.com/v1/717071"
- }
- ],
- "name": "cloudBlockStorage",
- "type": "volume"
- }
- ],
- "user": {
- "id": "224085",
- "roles": [
- {
- "id": "3",
- "description": "User Admin Role.",
- "name": "identity:user-admin"
- }
- ],
- "name": "myUsername",
- "RAX-AUTH:defaultRegion": "DFW"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/resources/flavor_get.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/resources/flavor_get.json b/openstack/openstack-reddwarf/src/test/resources/flavor_get.json
deleted file mode 100644
index ea07770..0000000
--- a/openstack/openstack-reddwarf/src/test/resources/flavor_get.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "flavor":{
- "id":1,
- "links":[
- {
- "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1",
- "rel":"self"
- },
- {
- "href":"https://ord.databases.api.rackspacecloud.com/flavors/1",
- "rel":"bookmark"
- }
- ],
- "name":"512MB Instance",
- "ram":512
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/resources/flavor_list.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/resources/flavor_list.json b/openstack/openstack-reddwarf/src/test/resources/flavor_list.json
deleted file mode 100644
index a9108f2..0000000
--- a/openstack/openstack-reddwarf/src/test/resources/flavor_list.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "flavors":[
- {
- "ram":512,
- "id":1,
- "links":[
- {
- "href":"https://localhost:8778/v1.0/811050/flavors/1",
- "rel":"self"
- },
- {
- "href":"https://localhost:8778/flavors/1",
- "rel":"bookmark"
- }
- ],
- "name":"512MB Instance"
- },
- {
- "ram":1024,
- "id":2,
- "links":[
- {
- "href":"https://localhost:8778/v1.0/811050/flavors/2",
- "rel":"self"
- },
- {
- "href":"https://localhost:8778/flavors/2",
- "rel":"bookmark"
- }
- ],
- "name":"1GB Instance"
- },
- {
- "ram":2048,
- "id":3,
- "links":[
- {
- "href":"https://localhost:8778/v1.0/811050/flavors/3",
- "rel":"self"
- },
- {
- "href":"https://localhost:8778/flavors/3",
- "rel":"bookmark"
- }
- ],
- "name":"2GB Instance"
- },
- {
- "ram":4096,
- "id":4,
- "links":[
- {
- "href":"https://localhost:8778/v1.0/811050/flavors/4",
- "rel":"self"
- },
- {
- "href":"https://localhost:8778/flavors/4",
- "rel":"bookmark"
- }
- ],
- "name":"4GB Instance"
- },
- {
- "ram":8192,
- "id":5,
- "links":[
- {
- "href":"https://localhost:8778/v1.0/811050/flavors/5",
- "rel":"self"
- },
- {
- "href":"https://localhost:8778/flavors/5",
- "rel":"bookmark"
- }
- ],
- "name":"8GB Instance"
- },
- {
- "ram":16384,
- "id":6,
- "links":[
- {
- "href":"https://localhost:8778/v1.0/811050/flavors/6",
- "rel":"self"
- },
- {
- "href":"https://localhost:8778/flavors/6",
- "rel":"bookmark"
- }
- ],
- "name":"16GB Instance"
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/resources/logback.xml b/openstack/openstack-reddwarf/src/test/resources/logback.xml
deleted file mode 100644
index a36c4c6..0000000
--- a/openstack/openstack-reddwarf/src/test/resources/logback.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<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>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/pom.xml b/openstack/openstack-swift/pom.xml
deleted file mode 100644
index 2a2d23d..0000000
--- a/openstack/openstack-swift/pom.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs-openstack</artifactId>
- <version>1.6.2-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.api -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>openstack-swift</artifactId>
- <name>jclouds openstack-swift api</name>
- <description>jclouds components to access an implementation of OpenStack Swift</description>
- <packaging>bundle</packaging>
-
- <properties>
- <!-- keystone endpoint -->
- <test.openstack-swift.endpoint>http://localhost:5000/v2.0/</test.openstack-swift.endpoint>
- <test.openstack-swift.api-version>1.0</test.openstack-swift.api-version>
- <test.openstack-swift.build-version />
- <test.openstack-swift.identity>FIXME_IDENTITY</test.openstack-swift.identity>
- <test.openstack-swift.credential>FIXME_CREDENTIALS</test.openstack-swift.credential>
- <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
- <jclouds.blobstore.httpstream.url>FIXME_HTTPURL</jclouds.blobstore.httpstream.url>
- <jclouds.blobstore.httpstream.md5>FIXME_HTTPMD5</jclouds.blobstore.httpstream.md5>
-
- <jclouds.osgi.export>org.jclouds.openstack.swift.v1*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.blobstore.internal;version="${jclouds.version}",
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-blobstore</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-blobstore</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${jclouds.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>
- <systemPropertyVariables>
- <test.openstack-swift.endpoint>${test.openstack-swift.endpoint}</test.openstack-swift.endpoint>
- <test.openstack-swift.api-version>${test.openstack-swift.api-version}</test.openstack-swift.api-version>
- <test.openstack-swift.build-version>${test.openstack-swift.build-version}</test.openstack-swift.build-version>
- <test.openstack-swift.identity>${test.openstack-swift.identity}</test.openstack-swift.identity>
- <test.openstack-swift.credential>${test.openstack-swift.credential}</test.openstack-swift.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>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApi.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApi.java
deleted file mode 100644
index 826914c..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApi.java
+++ /dev/null
@@ -1,74 +0,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.
- */
-package org.jclouds.openstack.swift.v1;
-
-import java.io.Closeable;
-import java.util.Set;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Region;
-import org.jclouds.location.functions.RegionToEndpoint;
-import org.jclouds.openstack.swift.v1.features.AccountApi;
-import org.jclouds.openstack.swift.v1.features.ContainerApi;
-import org.jclouds.openstack.swift.v1.features.ObjectApi;
-import org.jclouds.openstack.v2_0.features.ExtensionApi;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-
-import com.google.inject.Provides;
-
-/**
- * Provides access to Swift.
- * <p/>
- *
- * @see <a href="http://docs.openstack.org/api/openstack-object-storage/1.0/content">api doc</a>
- * @author Adrian Cole
- * @author Zack Shoylev
- */
-public interface SwiftApi extends Closeable {
- /**
- *
- * @return the Region codes configured
- */
- @Provides
- @Region
- Set<String> getConfiguredRegions();
-
- /**
- * Provides access to Extension features.
- */
- @Delegate
- ExtensionApi getExtensionApiForRegion(
- @EndpointParam(parser = RegionToEndpoint.class) @Nullable String region);
-
- /**
- * Provides access to Account features.
- */
- @Delegate
- AccountApi getAccountApiForRegion(@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region);
-
- /**
- * Provides access to Container features.
- */
- @Delegate
- ContainerApi getContainerApiForRegion(@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region);
-
- /**
- * Provides access to Object features.
- */
- @Delegate
- ObjectApi getObjectApiForRegion(@EndpointParam(parser = RegionToEndpoint.class) @Nullable String region);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApiMetadata.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApiMetadata.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApiMetadata.java
deleted file mode 100644
index 0cde00b..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApiMetadata.java
+++ /dev/null
@@ -1,91 +0,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.
- */
-package org.jclouds.openstack.swift.v1;
-
-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.apis.ApiMetadata;
-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.RegionModule;
-import org.jclouds.openstack.swift.v1.config.SwiftHttpApiModule;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for Swift 1.0 API
- *
- * @author Adrian Cole
- * @author Zack Shoylev
- */
-public class SwiftApiMetadata extends BaseHttpApiMetadata<SwiftApi> {
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public SwiftApiMetadata() {
- this(new Builder());
- }
-
- protected SwiftApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.setProperty(SERVICE_TYPE, ServiceType.OBJECT_STORE);
- properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<SwiftApi, Builder> {
-
- protected Builder() {
- id("openstack-swift")
- .name("OpenStack Swift Diablo+ API")
- .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
- .credentialName("${password}")
- .documentation(URI.create("http://docs.openstack.org/api/openstack-object-storage/1.0/content/ch_object-storage-dev-overview.html"))
- .version("1.0")
- .endpointName("KeyStone base url ending in /v2.0/")
- .defaultEndpoint("http://localhost:5000/v2.0/")
- .defaultProperties(SwiftApiMetadata.defaultProperties())
- .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
- .add(AuthenticationApiModule.class)
- .add(KeystoneAuthenticationModule.class)
- .add(RegionModule.class)
- .add(SwiftHttpApiModule.class).build());
- }
-
- @Override
- public SwiftApiMetadata build() {
- return new SwiftApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftHttpApiModule.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftHttpApiModule.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftHttpApiModule.java
deleted file mode 100644
index 9d35e2f..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftHttpApiModule.java
+++ /dev/null
@@ -1,87 +0,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.
- */
-package org.jclouds.openstack.swift.v1.config;
-import java.net.URI;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import javax.inject.Provider;
-import javax.inject.Singleton;
-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.json.config.GsonModule.DateAdapter;
-import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
-import org.jclouds.openstack.swift.v1.SwiftApi;
-import org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler;
-import org.jclouds.openstack.v2_0.domain.Extension;
-import org.jclouds.openstack.v2_0.functions.PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.config.HttpApiModule;
-import org.jclouds.rest.functions.ImplicitOptionalConverter;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.Multimap;
-import com.google.inject.Provides;
-
-/**
- * Configures the Swift connection.
- *
- * @author Adrian Cole
- * @author Zack Shoylev
- */
-@ConfiguresHttpApi
-public class SwiftHttpApiModule extends HttpApiModule<SwiftApi> {
-
- public SwiftHttpApiModule() {
- }
-
- @Override
- protected void configure() {
- bind(DateAdapter.class).to(Iso8601DateAdapter.class);
- bind(ImplicitOptionalConverter.class).to(PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.class);
- super.configure();
- }
-
- @Provides
- @Singleton
- public Multimap<URI, URI> aliases() {
- return ImmutableMultimap.<URI, URI>builder()
- .build();
- }
-
- @Provides
- @Singleton
- public LoadingCache<String, Set<? extends Extension>> provideExtensionsByZone(final Provider<SwiftApi> swiftApi) {
- return CacheBuilder.newBuilder().expireAfterWrite(23, TimeUnit.HOURS)
- .build(new CacheLoader<String, Set<? extends Extension>>() {
- @Override
- public Set<? extends Extension> load(String key) throws Exception {
- return swiftApi.get().getExtensionApiForRegion(key).list();
- }
- });
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(SwiftErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(SwiftErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(SwiftErrorHandler.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftProperties.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftProperties.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftProperties.java
deleted file mode 100644
index 70983bd..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/config/SwiftProperties.java
+++ /dev/null
@@ -1,26 +0,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.
- */
-package org.jclouds.openstack.swift.v1.config;
-
-/**
- * Configuration properties and constants used in openstack Swift connections.
- *
- * @author Adam Lowe
- */
-public class SwiftProperties {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Account.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Account.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Account.java
deleted file mode 100644
index aaa07ec..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Account.java
+++ /dev/null
@@ -1,120 +0,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.
- */
-package org.jclouds.openstack.swift.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-
-import java.beans.ConstructorProperties;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * @author Adrian Cole
- * @see <a href="http://docs.openstack.org/api/openstack-object-storage/1.0/content/retrieve-account-metadata.html">api doc</a>
- */
-public class Account {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromAccountMetadata(this);
- }
-
- public static class Builder {
- protected int containerCount;
- protected long bytesUsed;
-
- /**
- * @see Account#getContainerCount()
- */
- public Builder containerCount(int containerCount) {
- this.containerCount = containerCount;
- return this;
- }
-
- /**
- * @see Account#getBytesUsed()
- */
- public Builder bytesUsed(long bytesUsed) {
- this.bytesUsed = bytesUsed;
- return this;
- }
-
- public Account build() {
- return new Account(containerCount, bytesUsed);
- }
-
- public Builder fromAccountMetadata(Account from) {
- return containerCount(from.getContainerCount()).bytesUsed(from.getBytesUsed());
- }
- }
-
- protected int containerCount;
- protected long bytesUsed;
-
- @ConstructorProperties({"containerCount", "bytesUsed"})
- protected Account(int containerCount, long bytesUsed) {
- this.containerCount = containerCount;
- this.bytesUsed = bytesUsed;
- }
-
- /**
- *
- * @return the number of containers in OpenStack Object Storage for the account
- */
- public int getContainerCount() {
- return containerCount;
- }
-
- /**
- * @return the total bytes stored in OpenStack Object Storage for the account
- */
- public long getBytesUsed() {
- return bytesUsed;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof Account) {
- final Account other = Account.class.cast(object);
- return equal(getContainerCount(), other.getContainerCount()) && equal(getBytesUsed(), other.getBytesUsed());
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getContainerCount(), getBytesUsed());
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return toStringHelper("").add("containerCount", getContainerCount()).add("bytesUsed", getBytesUsed());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Container.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Container.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Container.java
deleted file mode 100644
index 4a62906..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/Container.java
+++ /dev/null
@@ -1,157 +0,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.
- */
-package org.jclouds.openstack.swift.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * retrieve a list of existing storage containers ordered by name. The sort order for the name is
- * based on a binary comparison, a single built-in collating sequence that compares string data
- * using SQLite's memcmp() function, regardless of text encoding.
- *
- * @author Adrian Cole
- * @see <a
- * href="http://docs.openstack.org/api/openstack-object-storage/1.0/content/s_listcontainers.html">api
- * doc</a>
- */
-public class Container implements Comparable<Container> {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromContainer(this);
- }
-
- public static class Builder {
- protected String name;
- protected int count;
- protected int bytes;
-
- /**
- * @see Container#getName()
- */
- public Builder name(String name) {
- this.name = checkNotNull(name, "name");
- return this;
- }
-
- /**
- * @see Container#getCount()
- */
- public Builder count(int count) {
- this.count = count;
- return this;
- }
-
- /**
- * @see Container#getBytes()
- */
- public Builder bytes(int bytes) {
- this.bytes = bytes;
- return this;
- }
-
- public Container build() {
- return new Container(name, count, bytes);
- }
-
- public Builder fromContainer(Container from) {
- return name(from.getName()).count(from.getCount()).bytes(from.getBytes());
- }
- }
-
- protected String name;
- protected int count;
- protected int bytes;
-
- @ConstructorProperties({"name", "count", "bytes"})
- protected Container(String name, int count, int bytes) {
- this.name = checkNotNull(name, "name");
- this.count = count;
- this.bytes = bytes;
- }
-
- /**
- *
- * @return the name of the container
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- * @return the number of objects in the container
- */
- public int getCount() {
- return count;
- }
-
- /**
- * @return the total bytes stored in this container
- */
- public int getBytes() {
- return bytes;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof Container) {
- final Container other = Container.class.cast(object);
- return equal(getName(), other.getName()) && equal(getCount(), other.getCount())
- && equal(getBytes(), other.getBytes());
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getName(), getCount(), getBytes());
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return toStringHelper("").add("name", getName()).add("count", getCount()).add("bytes", getBytes());
- }
-
- @Override
- public int compareTo(Container that) {
- if (that == null)
- return 1;
- if (this == that)
- return 0;
- return this.getName().compareTo(that.getName());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/AccountApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/AccountApi.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/AccountApi.java
deleted file mode 100644
index 4c7f0e8..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/AccountApi.java
+++ /dev/null
@@ -1,49 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import javax.ws.rs.HEAD;
-import javax.ws.rs.Path;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.swift.v1.domain.Account;
-import org.jclouds.openstack.swift.v1.functions.ParseAccountMetadataResponseFromHeaders;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-
-/**
- * Storage Account Services
- *
- * @author Adrian Cole
- * @author Zack Shoylev
- * @see <a
- * href="http://docs.openstack.org/api/openstack-object-storage/1.0/content/storage-account-services.html"
- * >api doc</a>
- */
-@RequestFilters(AuthenticateRequest.class)
-public interface AccountApi {
-
- /**
- * Retrieve Account Metadata
- *
- * @return account metadata including container count and bytes used
- */
- @HEAD
- @ResponseParser(ParseAccountMetadataResponseFromHeaders.class)
- @Path("/")
- Account get();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ContainerApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ContainerApi.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ContainerApi.java
deleted file mode 100644
index 5696d77..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ContainerApi.java
+++ /dev/null
@@ -1,70 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.MediaType;
-import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.swift.v1.domain.Container;
-import org.jclouds.openstack.swift.v1.options.ListContainersOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.QueryParams;
-import org.jclouds.rest.annotations.RequestFilters;
-
-import com.google.common.collect.FluentIterable;
-
-/**
- * Storage Container Services
- *
- * @author Adrian Cole
- * @author Zack Shoylev
- * @see <a href=
- * "http://docs.openstack.org/api/openstack-object-storage/1.0/content/storage-container-services.html"
- * >api doc</a>
- */
-@RequestFilters(AuthenticateRequest.class)
-public interface ContainerApi {
-
- /**
- * @see #list(ListContainersOptions)
- */
- @GET
- @Consumes(MediaType.APPLICATION_JSON)
- @QueryParams(keys = "format", values = "json")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- @Path("/")
- FluentIterable<? extends Container> list();
-
- /**
- * retrieve a list of existing storage containers ordered by name. The sort order for the name is
- * based on a binary comparison, a single built-in collating sequence that compares string data
- * using SQLite's memcmp() function, regardless of text encoding.
- *
- * @param options
- * @return a list of existing storage containers ordered by name.
- */
- @GET
- @Consumes(MediaType.APPLICATION_JSON)
- @QueryParams(keys = "format", values = "json")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- @Path("/")
- FluentIterable<? extends Container> list(ListContainersOptions options);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java
deleted file mode 100644
index 93775a4..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java
+++ /dev/null
@@ -1,40 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.rest.annotations.RequestFilters;
-
-/**
- * Storage Object Services An object represents the data and any metadata for the files stored in
- * the system. Through the ReST interface, metadata for an object can be included by adding custom
- * HTTP headers to the request and the data payload as the request body. Objects cannot exceed 5GB
- * and must have names that do not exceed 1024 bytes after URL encoding. However, objects larger
- * than 5GB can be segmented and then concatenated together so that you can upload 5 GB segments and
- * download a single concatenated object. You can work with the segments and manifests directly with
- * HTTP requests.
- *
- * @author Adrian Cole
- * @author Zack Shoylev
- * @see <a href=
- * "http://docs.openstack.org/api/openstack-object-storage/1.0/content/storage-object-services.html"
- * >api doc</a>
- */
-@RequestFilters(AuthenticateRequest.class)
-public interface ObjectApi {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseAccountMetadataResponseFromHeaders.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseAccountMetadataResponseFromHeaders.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseAccountMetadataResponseFromHeaders.java
deleted file mode 100644
index 6fb20fe..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseAccountMetadataResponseFromHeaders.java
+++ /dev/null
@@ -1,40 +0,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.
- */
-package org.jclouds.openstack.swift.v1.functions;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.swift.v1.domain.Account;
-
-import com.google.common.base.Function;
-
-/**
- * This parses {@link Account} from HTTP headers.
- *
- * @author James Murty
- */
-public class ParseAccountMetadataResponseFromHeaders implements Function<HttpResponse, Account> {
-
- /**
- * parses the http response headers to create a new {@link Account} object.
- */
- public Account apply(HttpResponse from) {
- return Account.builder()
- .bytesUsed(Long.parseLong(from.getFirstHeaderOrNull("X-Account-Bytes-Used")))
- .containerCount(Integer.parseInt(from.getFirstHeaderOrNull("X-Account-Container-Count")))
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/handlers/SwiftErrorHandler.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/handlers/SwiftErrorHandler.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/handlers/SwiftErrorHandler.java
deleted file mode 100644
index 2cd5343..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/handlers/SwiftErrorHandler.java
+++ /dev/null
@@ -1,80 +0,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.
- */
-package org.jclouds.openstack.swift.v1.handlers;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.inject.Singleton;
-
-import org.jclouds.blobstore.ContainerNotFoundException;
-import org.jclouds.blobstore.KeyNotFoundException;
-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;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- *
- * @author Adrian Cole
- *
- */
-// TODO: is there error spec someplace? let's type errors, etc.
-@Singleton
-public class SwiftErrorHandler implements HttpErrorHandler {
- public static final String PREFIX = "^/v[0-9][^/]*/[a-zA-Z]+_[^/]+/";
- public static final Pattern CONTAINER_PATH = Pattern.compile(PREFIX + "([^/]+)$");
- public static final Pattern CONTAINER_KEY_PATH = Pattern.compile(PREFIX + "([^/]+)/(.*)");
-
- 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);
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 401:
- exception = new AuthorizationException(exception.getMessage(), exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- String path = command.getCurrentRequest().getEndpoint().getPath();
- Matcher matcher = CONTAINER_PATH.matcher(path);
- Exception oldException = exception;
- if (matcher.find()) {
- exception = new ContainerNotFoundException(matcher.group(1), message);
- exception.initCause(oldException);
- } else {
- matcher = CONTAINER_KEY_PATH.matcher(path);
- if (matcher.find()) {
- exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message);
- exception.initCause(oldException);
- }
- }
- }
- break;
- }
- command.setException(exception);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/options/ListContainersOptions.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/options/ListContainersOptions.java b/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/options/ListContainersOptions.java
deleted file mode 100644
index 2efa90b..0000000
--- a/openstack/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/options/ListContainersOptions.java
+++ /dev/null
@@ -1,77 +0,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.
- */
-package org.jclouds.openstack.swift.v1.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Contains options supported in the REST API for the GET container operation. <h2>
- */
-public class ListContainersOptions extends BaseHttpRequestOptions {
- public static final ListContainersOptions NONE = new ListContainersOptions();
-
- /**
- * Given a string value x, return object names greater in value than the specified marker.
- */
- public ListContainersOptions marker(String marker) {
- queryParameters.put("marker", checkNotNull(marker, "marker"));
- return this;
- }
-
- public String getMarker() {
- return getFirstQueryOrNull("marker");
- }
-
- /**
- * For an integer value n, limits the number of results to n values.
- */
- public ListContainersOptions limit(int limit) {
- checkState(limit >= 0, "limit must be >= 0");
- checkState(limit <= 10000, "limit must be <= 10000");
- queryParameters.put("limit", Integer.toString(limit));
- return this;
- }
-
- public int getLimit() {
- String val = getFirstQueryOrNull("limit");
- return val != null ? Integer.valueOf(val) : 10000;
- }
-
-
- public static class Builder {
-
- /**
- * @see ListContainersOptions#marker(String)
- */
- public static ListContainersOptions marker(String marker) {
- ListContainersOptions options = new ListContainersOptions();
- return options.marker(marker);
- }
-
- /**
- * @see ListContainersOptions#limit(int)
- */
- public static ListContainersOptions limit(int limit) {
- ListContainersOptions options = new ListContainersOptions();
- return options.limit(limit);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/openstack/openstack-swift/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index 84f1200..0000000
--- a/openstack/openstack-swift/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.openstack.swift.v1.SwiftApiMetadata
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/PasswordAuthenticationExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/PasswordAuthenticationExpectTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/PasswordAuthenticationExpectTest.java
deleted file mode 100644
index 7e0a746..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/PasswordAuthenticationExpectTest.java
+++ /dev/null
@@ -1,70 +0,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.
- */
-package org.jclouds.openstack.swift.v1;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.Properties;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiExpectTest;
-import org.jclouds.openstack.swift.v1.parse.ParseContainerListTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @see KeystoneProperties#CREDENTIAL_TYPE
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "PasswordAuthenticationExpectTest")
-public class PasswordAuthenticationExpectTest extends BaseSwiftApiExpectTest {
-
- /**
- * this reflects the properties that a user would pass to createContext
- */
- @Override
- protected Properties setupProperties() {
- Properties contextProperties = super.setupProperties();
- contextProperties.setProperty("jclouds.keystone.credential-type", "passwordCredentials");
- return contextProperties;
- }
-
- public void testListContainersWhenResponseIs2xx() throws Exception {
- HttpRequest list = HttpRequest
- .builder()
- .method("GET")
- .endpoint("https://objects.jclouds.org/v1.0/40806637803162/?format=json")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/container_list.json")).build();
-
- SwiftApi apiWhenContainersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertEquals(apiWhenContainersExist.getConfiguredRegions(), ImmutableSet.of("region-a.geo-1"));
-
- assertEquals(apiWhenContainersExist.getContainerApiForRegion("region-a.geo-1").list().toString(),
- new ParseContainerListTest().expected().toString());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftApiMetadataTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftApiMetadataTest.java
deleted file mode 100644
index 7b83ef1..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftApiMetadataTest.java
+++ /dev/null
@@ -1,36 +0,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.
- */
-package org.jclouds.openstack.swift.v1;
-
-import org.jclouds.View;
-import org.jclouds.apis.internal.BaseApiMetadataTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "SwiftApiMetadataTest")
-// public class SwiftApiMetadataTest extends BaseBlobStoreApiMetadataTest {
-public class SwiftApiMetadataTest extends BaseApiMetadataTest {
- public SwiftApiMetadataTest() {
- super(new SwiftApiMetadata(), ImmutableSet.<TypeToken<? extends View>> of());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftErrorHandlerTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftErrorHandlerTest.java
deleted file mode 100644
index ddd38dd..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/SwiftErrorHandlerTest.java
+++ /dev/null
@@ -1,115 +0,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.
- */
-package org.jclouds.openstack.swift.v1;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.IArgumentMatcher;
-import org.jclouds.blobstore.ContainerNotFoundException;
-import org.jclouds.blobstore.KeyNotFoundException;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "SwiftErrorHandlerTest")
-public class SwiftErrorHandlerTest {
-
- @Test
- public void test404SetsKeyNotFoundExceptionMosso() {
- assertCodeMakes("HEAD", URI
- .create("http://host/v1/MossoCloudFS_7064cdb1d49d4dcba3c899ac33e8409d/adriancole-blobstore1/key"), 404,
- "Not Found", "", KeyNotFoundException.class);
- }
-
- @Test
- public void test404SetsKeyNotFoundExceptionSwift() {
- assertCodeMakes("HEAD", URI
- .create("http://67.202.39.175:8080/v1/AUTH_7064cdb1d49d4dcba3c899ac33e8409d/adriancole-blobstore1/key"),
- 404, "Not Found", "", KeyNotFoundException.class);
- }
-
- @Test
- public void test404SetsContainerNotFoundExceptionMosso() {
- assertCodeMakes("HEAD", URI
- .create("http://host/v1/MossoCloudFS_7064cdb1d49d4dcba3c899ac33e8409d/adriancole-blobstore1"), 404,
- "Not Found", "", ContainerNotFoundException.class);
- }
-
- @Test
- public void test404SetsContainerNotFoundExceptionSwift() {
- assertCodeMakes("HEAD", URI
- .create("http://67.202.39.175:8080/v1/AUTH_7064cdb1d49d4dcba3c899ac33e8409d/adriancole-blobstore1"),
- 404, "Not Found", "", ContainerNotFoundException.class);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String content,
- Class<? extends Exception> expected) {
- assertCodeMakes(method, uri, statusCode, message, "text/plain", content, expected);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
- String content, Class<? extends Exception> expected) {
-
- SwiftErrorHandler function = new SwiftErrorHandler();
-
- HttpCommand command = createMock(HttpCommand.class);
- HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
- HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
- response.getPayload().getContentMetadata().setContentType(contentType);
-
- expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
- command.setException(classEq(expected));
-
- replay(command);
-
- function.handleError(command, response);
-
- verify(command);
- }
-
- public static Exception classEq(final Class<? extends Exception> in) {
- reportMatcher(new IArgumentMatcher() {
-
- @Override
- public void appendTo(StringBuffer buffer) {
- buffer.append("classEq(");
- buffer.append(in);
- buffer.append(")");
- }
-
- @Override
- public boolean matches(Object arg) {
- return arg.getClass() == in;
- }
-
- });
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiExpectTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiExpectTest.java
deleted file mode 100644
index 3eb9bd6..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiExpectTest.java
+++ /dev/null
@@ -1,55 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.swift.v1.SwiftApi;
-import org.jclouds.openstack.swift.v1.domain.Account;
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiExpectTest;
-import org.testng.annotations.Test;
-
-/**
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "AccountApiExpectTest")
-public class AccountApiExpectTest extends BaseSwiftApiExpectTest {
-
- public void testGetAccountMetadataWhenResponseIs2xx() throws Exception {
-
- HttpRequest get = HttpRequest
- .builder()
- .method("HEAD")
- .endpoint("https://objects.jclouds.org/v1.0/40806637803162/")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(204)
- .addHeader("X-Account-Container-Count", "3")
- .addHeader("X-Account-Bytes-Used", "323479").build();
-
- SwiftApi apiWhenExists = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, listResponse);
-
- assertEquals(
- apiWhenExists.getAccountApiForRegion("region-a.geo-1").get(),
- Account.builder().containerCount(3).bytesUsed(323479).build());
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiLiveTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiLiveTest.java
deleted file mode 100644
index d112e1c..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiLiveTest.java
+++ /dev/null
@@ -1,44 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.openstack.swift.v1.domain.Account;
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiLiveTest;
-import org.testng.annotations.Test;
-
-/**
- * @author Adrian Cole
- * @author Zack Shoylev
- */
-@Test(groups = "live", testName = "ContainerApiLiveTest")
-public class AccountApiLiveTest extends BaseSwiftApiLiveTest {
-
- @Test
- public void testGetAccountMetadata() throws Exception {
- for (String regionId : api.getConfiguredRegions()) {
- AccountApi accountApi = api.getAccountApiForRegion(regionId);
- Account account = accountApi.get();
- assertNotNull(account);
- assertTrue(account.getContainerCount() >= 0);
- assertTrue(account.getBytesUsed() >= 0);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiExpectTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiExpectTest.java
deleted file mode 100644
index 7dd68d0..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiExpectTest.java
+++ /dev/null
@@ -1,74 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.swift.v1.SwiftApi;
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiExpectTest;
-import org.jclouds.openstack.swift.v1.parse.ParseContainerListTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ContainerAsyncApiTest")
-public class ContainerApiExpectTest extends BaseSwiftApiExpectTest {
- public void testListContainersWhenResponseIs2xx() throws Exception {
-
- HttpRequest list = HttpRequest
- .builder()
- .method("GET")
- .endpoint("https://objects.jclouds.org/v1.0/40806637803162/?format=json")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/container_list.json")).build();
-
- SwiftApi apiWhenContainersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertEquals(
- apiWhenContainersExist.getContainerApiForRegion("region-a.geo-1").list()
- .toString(), new ParseContainerListTest().expected().toString());
- }
-
- public void testListContainersWhenResponseIs404() throws Exception {
- HttpRequest list = HttpRequest
- .builder()
- .method("GET")
- .endpoint("https://objects.jclouds.org/v1.0/40806637803162/?format=json")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
-
- SwiftApi apiWhenNoContainersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertEquals(apiWhenNoContainersExist.getContainerApiForRegion("region-a.geo-1").list().toSet(),
- ImmutableSet.of());
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiLiveTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiLiveTest.java
deleted file mode 100644
index d547a45..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiLiveTest.java
+++ /dev/null
@@ -1,48 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.openstack.swift.v1.domain.Container;
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.FluentIterable;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "live", testName = "ContainerApiLiveTest")
-public class ContainerApiLiveTest extends BaseSwiftApiLiveTest {
-
- @Test
- public void testListContainers() throws Exception {
- for (String regionId : api.getConfiguredRegions()) {
- ContainerApi containerApi = api.getContainerApiForRegion(regionId);
- FluentIterable<? extends Container> response = containerApi.list();
- assertNotNull(response);
- for (Container container : response) {
- assertNotNull(container.getName());
- assertTrue(container.getCount() >= 0);
- assertTrue(container.getBytes() >= 0);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiExpectTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiExpectTest.java
deleted file mode 100644
index db521d2..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiExpectTest.java
+++ /dev/null
@@ -1,28 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiExpectTest;
-import org.testng.annotations.Test;
-
-/**
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ObjectAsyncApiTest")
-public class ObjectApiExpectTest extends BaseSwiftApiExpectTest {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
deleted file mode 100644
index a9e83e7..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
+++ /dev/null
@@ -1,28 +0,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.
- */
-package org.jclouds.openstack.swift.v1.features;
-
-import org.jclouds.openstack.swift.v1.internal.BaseSwiftApiLiveTest;
-import org.testng.annotations.Test;
-
-/**
- * @author Adrian Cole
- */
-@Test(groups = "live", testName = "ObjectApiLiveTest")
-public class ObjectApiLiveTest extends BaseSwiftApiLiveTest {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiExpectTest.java b/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiExpectTest.java
deleted file mode 100644
index 2b18142..0000000
--- a/openstack/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/internal/BaseSwiftApiExpectTest.java
+++ /dev/null
@@ -1,28 +0,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.
- */
-package org.jclouds.openstack.swift.v1.internal;
-
-import org.jclouds.openstack.swift.v1.SwiftApi;
-
-/**
- * Base class for writing KeyStone Rest Api Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseSwiftApiExpectTest extends BaseSwiftExpectTest<SwiftApi> {
-
-}
[3/6] Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiExpectTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiExpectTest.java
deleted file mode 100644
index 7471382..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiExpectTest.java
+++ /dev/null
@@ -1,28 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.internal;
-
-import org.jclouds.openstack.quantum.v1_0.QuantumApi;
-
-/**
- * Base class for writing Quantum Rest Api Expect tests
- *
- * @author Adam Lowe
- */
-public class BaseQuantumApiExpectTest extends BaseQuantumExpectTest<QuantumApi> {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiLiveTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiLiveTest.java
deleted file mode 100644
index 42985fe..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumApiLiveTest.java
+++ /dev/null
@@ -1,44 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.internal;
-
-import java.util.Properties;
-import org.jclouds.apis.BaseApiLiveTest;
-import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
-import org.jclouds.openstack.quantum.v1_0.QuantumApi;
-import org.testng.annotations.Test;
-
-/**
- * Tests behavior of {@code QuantumApi}
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- */
-@Test(groups = "live")
-public class BaseQuantumApiLiveTest extends BaseApiLiveTest<QuantumApi> {
-
- public BaseQuantumApiLiveTest() {
- provider = "openstack-quantum";
- }
-
- @Override
- protected Properties setupProperties() {
- Properties props = super.setupProperties();
- setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
- return props;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumExpectTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumExpectTest.java
deleted file mode 100644
index 472d5ca..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/internal/BaseQuantumExpectTest.java
+++ /dev/null
@@ -1,57 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.internal;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-/**
- * Base class for writing Quantum Expect tests
- *
- * @author Adam Lowe
- */
-public class BaseQuantumExpectTest<T> extends BaseRestApiExpectTest<T> {
- protected HttpRequest keystoneAuthWithUsernameAndPassword;
- protected HttpRequest keystoneAuthWithAccessKeyAndSecretKey;
- protected String authToken;
- protected HttpResponse responseWithKeystoneAccess;
- protected String endpoint = "https://csnode.jclouds.org:9696/v1.0";
-
- public BaseQuantumExpectTest() {
- provider = "openstack-quantum";
- keystoneAuthWithUsernameAndPassword = KeystoneFixture.INSTANCE.initialAuthWithUsernameAndPasswordAndTenantName(identity,
- credential);
- keystoneAuthWithAccessKeyAndSecretKey = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantName(identity,
- credential);
-
- authToken = KeystoneFixture.INSTANCE.getAuthToken();
- responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess();
- // now, createContext arg will need tenant prefix
- identity = KeystoneFixture.INSTANCE.getTenantName() + ":" + identity;
- }
-
- protected HttpRequest.Builder<?> authenticatedGET() {
- return HttpRequest.builder()
- .method("GET")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseAttachmentTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseAttachmentTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseAttachmentTest.java
deleted file mode 100644
index 92f77c5..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseAttachmentTest.java
+++ /dev/null
@@ -1,45 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.quantum.v1_0.domain.Attachment;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParseAttachmentTest")
-public class ParseAttachmentTest extends BaseItemParserTest<Attachment> {
-
- @Override
- public String resource() {
- return "/attachment.json";
- }
-
- @Override
- @SelectJson("attachment")
- @Consumes(MediaType.APPLICATION_JSON)
- public Attachment expected() {
- return Attachment.builder().id("jclouds-live-test").build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkDetailsTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkDetailsTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkDetailsTest.java
deleted file mode 100644
index 540ed8e..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkDetailsTest.java
+++ /dev/null
@@ -1,49 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.quantum.v1_0.domain.NetworkDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Port;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParseNetworkDetailsTest")
-public class ParseNetworkDetailsTest extends BaseItemParserTest<NetworkDetails> {
-
- @Override
- public String resource() {
- return "/network_details.json";
- }
-
- @Override
- @SelectJson("network")
- @Consumes(MediaType.APPLICATION_JSON)
- public NetworkDetails expected() {
- return NetworkDetails.builder().name("jclouds-port-test").id("25e3e0f8-f1f0-4850-97a3-8d5393c3385b")
- .ports(ImmutableSet.of(Port.builder().state(Port.State.DOWN).id("908391f6-ef3c-4bc6-acec-46582f9b231d").build())).build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkTest.java
deleted file mode 100644
index 5d9038a..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParseNetworkTest.java
+++ /dev/null
@@ -1,45 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.quantum.v1_0.domain.Network;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParseNetworkTest")
-public class ParseNetworkTest extends BaseItemParserTest<Network> {
-
- @Override
- public String resource() {
- return "/network.json";
- }
-
- @Override
- @SelectJson("network")
- @Consumes(MediaType.APPLICATION_JSON)
- public Network expected() {
- return Network.builder().name("jclouds-wibble").id("624312ff-d14b-4ba3-9834-1c78d23d574d").build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortDetailsTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortDetailsTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortDetailsTest.java
deleted file mode 100644
index f072565..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortDetailsTest.java
+++ /dev/null
@@ -1,47 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.quantum.v1_0.domain.Attachment;
-import org.jclouds.openstack.quantum.v1_0.domain.Port;
-import org.jclouds.openstack.quantum.v1_0.domain.PortDetails;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-/**
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParsePortDetailsTest")
-public class ParsePortDetailsTest extends BaseItemParserTest<PortDetails> {
-
- @Override
- public String resource() {
- return "/port_details.json";
- }
-
- @Override
- @SelectJson("port")
- @Consumes(MediaType.APPLICATION_JSON)
- public PortDetails expected() {
- return PortDetails.builder().id("0ccbe514-e36b-475b-91c9-208dfd96d3ac").state(Port.State.DOWN)
- .attachment(Attachment.builder().id("jclouds-live-test").build()).build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortTest.java
deleted file mode 100644
index d5d6d1c..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/parse/ParsePortTest.java
+++ /dev/null
@@ -1,45 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.quantum.v1_0.domain.Port;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParsePortTest")
-public class ParsePortTest extends BaseItemParserTest<Port> {
-
- @Override
- public String resource() {
- return "/port.json";
- }
-
- @Override
- @SelectJson("port")
- @Consumes(MediaType.APPLICATION_JSON)
- public Port expected() {
- return Port.builder().id("646c123b-871a-4124-9fa2-a94f04a582df").state(Port.State.DOWN).build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/attachment.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/attachment.json b/openstack/openstack-quantum/src/test/resources/attachment.json
deleted file mode 100644
index e135055..0000000
--- a/openstack/openstack-quantum/src/test/resources/attachment.json
+++ /dev/null
@@ -1 +0,0 @@
-{"attachment":{"id":"jclouds-live-test"}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/list_network_refs.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/list_network_refs.json b/openstack/openstack-quantum/src/test/resources/list_network_refs.json
deleted file mode 100644
index d6daf8d..0000000
--- a/openstack/openstack-quantum/src/test/resources/list_network_refs.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{"networks": [
- {"id": "16dba3bc-f3fa-4775-afdc-237e12c72f6a"},
- {"id": "1a104cf5-cb18-4d35-9407-2fd2646d9d0b"},
- {"id": "31083ae2-420d-48b2-ac98-9f7a4fd8dbdc"},
- {"id": "49c6d6fa-ff2a-459d-b975-75a8d31c9a89"},
- {"id": "5cb3d6f4-62cb-41c9-b964-ba7d9df79e4e"},
- {"id": "5d51d012-3491-4db7-b1b5-6f254015015d"},
- {"id": "5f9cf7dc-22ca-4097-8e49-1cc8b23faf17"},
- {"id": "6319ecad-6bff-48b2-9b53-02ede8cb7588"},
- {"id": "6ba4c788-661f-49ab-9bf8-5f10cbbb2f57"},
- {"id": "74ed170b-5069-4353-ab38-9719766dc57e"},
- {"id": "b71fcac1-e864-4031-8c5b-edbecd9ece36"},
- {"id": "c7681895-d84d-4650-9ca0-82c72036b855"}
-]}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/list_networks.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/list_networks.json b/openstack/openstack-quantum/src/test/resources/list_networks.json
deleted file mode 100644
index b5c7839..0000000
--- a/openstack/openstack-quantum/src/test/resources/list_networks.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{"networks": [
- {"name": "jclouds-port-test", "id": "16dba3bc-f3fa-4775-afdc-237e12c72f6a"},
- {"name": "wibble", "id": "1a104cf5-cb18-4d35-9407-2fd2646d9d0b"},
- {"name": "jclouds-test", "id": "31083ae2-420d-48b2-ac98-9f7a4fd8dbdc"},
- {"name": "jclouds-test", "id": "49c6d6fa-ff2a-459d-b975-75a8d31c9a89"},
- {"name": "wibble", "id": "5cb3d6f4-62cb-41c9-b964-ba7d9df79e4e"},
- {"name": "jclouds-port-test", "id": "5d51d012-3491-4db7-b1b5-6f254015015d"},
- {"name": "wibble", "id": "5f9cf7dc-22ca-4097-8e49-1cc8b23faf17"},
- {"name": "jclouds-test", "id": "6319ecad-6bff-48b2-9b53-02ede8cb7588"},
- {"name": "jclouds-port-test", "id": "6ba4c788-661f-49ab-9bf8-5f10cbbb2f57"},
- {"name": "jclouds-test", "id": "74ed170b-5069-4353-ab38-9719766dc57e"},
- {"name": "wibble", "id": "b71fcac1-e864-4031-8c5b-edbecd9ece36"},
- {"name": "jclouds-port-test", "id": "c7681895-d84d-4650-9ca0-82c72036b855"}
-]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/logback.xml b/openstack/openstack-quantum/src/test/resources/logback.xml
deleted file mode 100644
index a36c4c6..0000000
--- a/openstack/openstack-quantum/src/test/resources/logback.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<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>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/network.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/network.json b/openstack/openstack-quantum/src/test/resources/network.json
deleted file mode 100644
index fec734d..0000000
--- a/openstack/openstack-quantum/src/test/resources/network.json
+++ /dev/null
@@ -1 +0,0 @@
-{"network": {"name": "jclouds-wibble", "id": "624312ff-d14b-4ba3-9834-1c78d23d574d"}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/network_details.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/network_details.json b/openstack/openstack-quantum/src/test/resources/network_details.json
deleted file mode 100644
index 0ee7025..0000000
--- a/openstack/openstack-quantum/src/test/resources/network_details.json
+++ /dev/null
@@ -1 +0,0 @@
-{"network": {"ports": [{"state": "DOWN", "id": "908391f6-ef3c-4bc6-acec-46582f9b231d"}], "name": "jclouds-port-test", "id": "25e3e0f8-f1f0-4850-97a3-8d5393c3385b"}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/port.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/port.json b/openstack/openstack-quantum/src/test/resources/port.json
deleted file mode 100644
index 371fcb4..0000000
--- a/openstack/openstack-quantum/src/test/resources/port.json
+++ /dev/null
@@ -1 +0,0 @@
-{"port": {"state": "DOWN", "id": "646c123b-871a-4124-9fa2-a94f04a582df"}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/resources/port_details.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/resources/port_details.json b/openstack/openstack-quantum/src/test/resources/port_details.json
deleted file mode 100644
index 5481135..0000000
--- a/openstack/openstack-quantum/src/test/resources/port_details.json
+++ /dev/null
@@ -1 +0,0 @@
-{"port": {"state": "DOWN", "id": "0ccbe514-e36b-475b-91c9-208dfd96d3ac", "attachment": {"id": "jclouds-live-test"}}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/pom.xml b/openstack/openstack-reddwarf/pom.xml
deleted file mode 100644
index d8de2a6..0000000
--- a/openstack/openstack-reddwarf/pom.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs-openstack</artifactId>
- <version>1.6.2-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.api -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>openstack-reddwarf</artifactId>
- <name>jclouds openstack-reddwarf api</name>
- <description>jclouds components to access an implementation of OpenStack RedDwarf</description>
- <packaging>bundle</packaging>
-
- <properties>
- <!-- keystone endpoint -->
- <test.openstack-reddwarf.endpoint>http://localhost:5000/v2.0/</test.openstack-reddwarf.endpoint>
- <!-- keystone version -->
- <test.openstack-reddwarf.api-version>1.0</test.openstack-reddwarf.api-version>
- <test.openstack-reddwarf.build-version />
- <test.openstack-reddwarf.identity>FIXME_IDENTITY</test.openstack-reddwarf.identity>
- <test.openstack-reddwarf.credential>FIXME_CREDENTIALS</test.openstack-reddwarf.credential>
- <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
-
- <jclouds.osgi.export>org.jclouds.openstack.reddwarf.v1_0*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${jclouds.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>
- <systemPropertyVariables>
- <test.openstack-reddwarf.endpoint>${test.openstack-reddwarf.endpoint}</test.openstack-reddwarf.endpoint>
- <test.openstack-reddwarf.api-version>${test.openstack-reddwarf.api-version}</test.openstack-reddwarf.api-version>
- <test.openstack-reddwarf.build-version>${test.openstack-reddwarf.build-version}</test.openstack-reddwarf.build-version>
- <test.openstack-reddwarf.identity>${test.openstack-reddwarf.identity}</test.openstack-reddwarf.identity>
- <test.openstack-reddwarf.credential>${test.openstack-reddwarf.credential}</test.openstack-reddwarf.credential>
- <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApi.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApi.java
deleted file mode 100644
index 8ccf18d..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApi.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1;
-
-import java.io.Closeable;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Zone;
-import org.jclouds.location.functions.ZoneToEndpoint;
-import org.jclouds.openstack.keystone.v2_0.domain.Tenant;
-import org.jclouds.openstack.reddwarf.v1.features.FlavorApi;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-
-import com.google.common.base.Optional;
-import com.google.inject.Provides;
-
-/**
- * Provides access to RedDwarf.
- *
- * @see <a href="http://api.openstack.org/">API Doc</a>
- * @author Zack Shoylev
- */
-public interface RedDwarfApi extends Closeable{
- /**
- * @return the Zone codes configured
- */
- @Provides
- @Zone
- Set<String> getConfiguredZones();
-
- /**
- * Provides access to Flavor features.
- */
- @Delegate
- FlavorApi getFlavorApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides the Tenant
- */
- @Provides
- Optional<Tenant> getCurrentTenantId();
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApiMetadata.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApiMetadata.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApiMetadata.java
deleted file mode 100644
index 268aea6..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/RedDwarfApiMetadata.java
+++ /dev/null
@@ -1,96 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1;
-
-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.apis.ApiMetadata;
-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.reddwarf.v1.config.RedDwarfHttpApiModule;
-import org.jclouds.openstack.reddwarf.v1.config.RedDwarfParserModule;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for RedDwarf API
- *
- * @author Zack Shoylev
- */
-public class RedDwarfApiMetadata extends BaseHttpApiMetadata<RedDwarfApi> {
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public RedDwarfApiMetadata() {
- this(new Builder());
- }
-
- protected RedDwarfApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.setProperty(SERVICE_TYPE, ServiceType.DATABASE_SERVICE);
- properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<RedDwarfApi, Builder> {
-
- protected Builder() {
- id("openstack-reddwarf")
- .name("OpenStack RedDwarf API")
- .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
- .credentialName("${password}")
- .endpointName("Keystone base URL ending in /v2.0/")
- .documentation(URI.create("http://api.openstack.org/"))
- .version("1.0")
- .defaultEndpoint("http://localhost:5000/v2.0/")
- .defaultProperties(RedDwarfApiMetadata.defaultProperties())
- .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
- .add(AuthenticationApiModule.class)
- .add(KeystoneAuthenticationModule.class)
- .add(ZoneModule.class)
- .add(RedDwarfParserModule.class)
- .add(RedDwarfHttpApiModule.class)
- .build());
- }
-
- @Override
- public RedDwarfApiMetadata build() {
- return new RedDwarfApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfHttpApiModule.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfHttpApiModule.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfHttpApiModule.java
deleted file mode 100644
index ad63294..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfHttpApiModule.java
+++ /dev/null
@@ -1,82 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.config;
-
-import java.net.URI;
-
-import javax.inject.Singleton;
-
-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.json.config.GsonModule.DateAdapter;
-import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
-import org.jclouds.openstack.keystone.v2_0.domain.Access;
-import org.jclouds.openstack.keystone.v2_0.domain.Tenant;
-import org.jclouds.openstack.reddwarf.v1.RedDwarfApi;
-import org.jclouds.openstack.reddwarf.v1.handlers.RedDwarfErrorHandler;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.config.HttpApiModule;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.Multimap;
-import com.google.inject.Provides;
-
-/**
- * Configures the RedDwarf connection.
- *
- * @author Zack Shoylev
- */
-@ConfiguresHttpApi
-public class RedDwarfHttpApiModule extends HttpApiModule<RedDwarfApi> {
-
- @Override
- protected void configure() {
- bind(DateAdapter.class).to(Iso8601DateAdapter.class);
- super.configure();
- }
-
- @Provides
- @Singleton
- public Multimap<URI, URI> aliases() {
- return ImmutableMultimap.<URI, URI>builder().build();
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(RedDwarfErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(RedDwarfErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(RedDwarfErrorHandler.class);
- }
-
- @Provides
- Supplier<Optional<Tenant>> supplyTenant(Supplier<Access> access) {
- return Suppliers.compose(GetTenant.INSTANCE, access);
- }
-
- private static enum GetTenant implements Function<Access, Optional<Tenant>> {
- INSTANCE;
- public Optional<Tenant> apply(Access in){
- return in.getToken().getTenant();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfParserModule.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfParserModule.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfParserModule.java
deleted file mode 100644
index d61f92b..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/config/RedDwarfParserModule.java
+++ /dev/null
@@ -1,32 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.config;
-
-import org.jclouds.json.config.GsonModule;
-import org.jclouds.json.config.GsonModule.DateAdapter;
-
-import com.google.inject.AbstractModule;
-
-/**
- * @author Everett Toews
- */
-public class RedDwarfParserModule extends AbstractModule {
- @Override
- protected void configure() {
- bind(DateAdapter.class).to(GsonModule.Iso8601DateAdapter.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/domain/Flavor.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/domain/Flavor.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/domain/Flavor.java
deleted file mode 100644
index f12fa31..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/domain/Flavor.java
+++ /dev/null
@@ -1,167 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import java.beans.ConstructorProperties;
-import java.util.List;
-import org.jclouds.openstack.v2_0.domain.Link;
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableList;
-
-/**
- * An Openstack Reddwarf Flavor.
- *
- * @author Zack Shoylev
- */
-public class Flavor implements Comparable<Flavor>{
-
- private final int id;
- private final String name;
- private final int ram;
- private final List<Link> links;
-
- @ConstructorProperties({
- "id", "name", "ram", "links"
- })
- protected Flavor(int id, String name, int ram, List<Link> links) {
- this.id = id;
- this.name = checkNotNull(name, "name required");
- this.ram = ram;
- this.links = links;
- }
-
- /**
- * @return the id of this flavor
- */
- public int getId() {
- return this.id;
- }
-
- /**
- * @return the name of this flavor
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * @return the RAM amount for this flavor
- */
- public int getRam() {
- return this.ram;
- }
-
- /**
- * @return the flavor links for this flavor. These are used during database instance creation.
- */
- public List<Link> getLinks() {
- return this.links;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- Flavor that = Flavor.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("id", id).add("name", name).add("ram", ram);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- @Override
- public int compareTo(Flavor that) {
- if (that == null)
- return 1;
- if (this == that)
- return 0;
- return this.getId() > that.getId() ? +1 : this.getId() < this.getId() ? -1 : 0;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return new Builder().fromFlavor(this);
- }
-
- public static class Builder {
- protected int id;
- protected String name;
- protected int ram;
- protected List<Link> links;
-
- /**
- * @see Flavor#getId()
- */
- public Builder id(int id) {
- this.id = id;
- return this;
- }
-
- /**
- * @see Flavor#getName()
- */
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @see Flavor#getRam()
- */
- public Builder ram(int ram) {
- this.ram = ram;
- return this;
- }
-
- /**
- * @see Flavor#getLinks()
- */
- public Builder links(List<Link> links) {
- this.links = ImmutableList.copyOf(links);
- return this;
- }
-
- public Flavor build() {
- return new Flavor(id, name, ram, links);
- }
-
- public Builder fromFlavor(Flavor in) {
- return this
- .id(in.getId())
- .name(in.getName())
- .ram(in.getRam())
- .links(in.getLinks());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApi.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApi.java
deleted file mode 100644
index 1f6d424..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApi.java
+++ /dev/null
@@ -1,90 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.features;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.reddwarf.v1.domain.Flavor;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.SkipEncoding;
-
-import com.google.common.collect.FluentIterable;
-
-/**
- * This API strictly for listing and retrieving Flavor. Flavors cannot be created or deleted.
- * @see org.jclouds.openstack.reddwarf.v1.domain.Flavor
- * Flavor
- *
- * @see <a href="http://sourceforge.net/apps/trac/reddwarf/">api doc</a>
- * @see <a
- * href="https://github.com/reddwarf-nextgen/reddwarf">api
- * src</a>
- *
- * @author Zack Shoylev
- */
-@SkipEncoding({'/', '='})
-@RequestFilters(AuthenticateRequest.class)
-public interface FlavorApi {
- /**
- * Returns a summary list of Flavors.
- *
- * @return The list of Flavors
- */
- @Named("flavor:list")
- @GET
- @Path("/flavors")
- @SelectJson("flavors")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<Flavor> list();
-
- /**
- * Returns a Flavor by id
- *
- * @return Flavor
- */
- @Named("flavors:get/{id}")
- @GET
- @Path("/flavors/{id}")
- @SelectJson("flavor")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- Flavor get(@PathParam("id") int flavorId);
-
- /**
- * Returns a list of Flavors by Account ID (Tenant Id)
- *
- * @return The list of Flavors for Account/Tenant Id
- */
- @Named("flavors:get/{id}")
- @GET
- @Path("/flavors/{id}")
- @SelectJson("flavors")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<Flavor> list(@PathParam("id") String accountId);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/handlers/RedDwarfErrorHandler.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/handlers/RedDwarfErrorHandler.java b/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/handlers/RedDwarfErrorHandler.java
deleted file mode 100644
index 7628bc5..0000000
--- a/openstack/openstack-reddwarf/src/main/java/org/jclouds/openstack/reddwarf/v1/handlers/RedDwarfErrorHandler.java
+++ /dev/null
@@ -1,69 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.handlers;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-
-import javax.inject.Singleton;
-
-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 org.jclouds.rest.InsufficientResourcesException;
-import org.jclouds.rest.ResourceNotFoundException;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- *
- * @author Zack Shoylev
- *
- */
-@Singleton
-public class RedDwarfErrorHandler 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);
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 400:
- if (message.contains("quota exceeded"))
- exception = new InsufficientResourcesException(message, exception);
- break;
- case 401:
- case 403:
- exception = new AuthorizationException(message, exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- exception = new ResourceNotFoundException(message, exception);
- }
- break;
- case 413:
- exception = new InsufficientResourcesException(message, exception);
- break;
- }
- command.setException(exception);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/openstack/openstack-reddwarf/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index 1ec7be5..0000000
--- a/openstack/openstack-reddwarf/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.openstack.reddwarf.v1.RedDwarfApiMetadata
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/domain/FlavorTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/domain/FlavorTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/domain/FlavorTest.java
deleted file mode 100644
index 3104440..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/domain/FlavorTest.java
+++ /dev/null
@@ -1,55 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.domain;
-
-import org.jclouds.http.Uris;
-import org.jclouds.openstack.v2_0.domain.Link;
-import org.jclouds.openstack.v2_0.domain.Link.Relation;
-import org.testng.annotations.Test;
-import com.google.common.collect.ImmutableList;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-
-@Test(groups = "unit", testName = "FlavorTest")
-public class FlavorTest {
- public void testFlavorForId() {
- Flavor flavor1 = forId(1);
- Flavor flavor2 = forId(2);
- assertEquals(flavor1.getId(), 1);
- assertEquals(flavor1.getName(), "small");
- assertFalse(flavor1.equals(flavor2));
- }
-
- /**
- * Creates a dummy Flavor when you need a Flavor with just the flavorId.
- *
- * 1. name = small
- * 2. ram = 512
- * 3. links = self, bookmark
- */
- public static Flavor forId(int flavorId) {
- return Flavor.builder()
- .id(flavorId)
- .name("small")
- .ram(512)
- .links(
- ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("http://test1").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("http://test2").build() )
- ) ).build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiExpectTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiExpectTest.java
deleted file mode 100644
index 502e52a..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiExpectTest.java
+++ /dev/null
@@ -1,111 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.reddwarf.v1.RedDwarfApi;
-import org.jclouds.openstack.reddwarf.v1.domain.Flavor;
-import org.jclouds.openstack.reddwarf.v1.internal.BaseRedDwarfApiExpectTest;
-import org.testng.annotations.Test;
-
-/**
- * Tests FlavorApi Guice wiring and parsing
- *
- * @author Zack Shoylev
- */
-@Test(groups = "unit", testName = "FlavorApiExpectTest")
-public class FlavorApiExpectTest extends BaseRedDwarfApiExpectTest {
-
- public void testListFlavors() {
- URI endpoint = URI.create("http://172.16.0.1:8776/v1/3456/flavors");
- FlavorApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/flavor_list.json")).build()
- ).getFlavorApiForZone("RegionOne");
-
- Set<? extends Flavor> flavors = api.list().toSet();
- assertEquals(flavors.size(),6);
- assertEquals(flavors.iterator().next().getRam(), 512);
- }
-
- public void testListFlavorsFail() {
- URI endpoint = URI.create("http://172.16.0.1:8776/v1/3456/flavors");
- FlavorApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(404).build()
- ).getFlavorApiForZone("RegionOne");
-
- Set<? extends Flavor> flavors = api.list().toSet();
- assertTrue(flavors.isEmpty());
- }
-
- public void testGetFlavor() {
- URI endpoint = URI.create("http://172.16.0.1:8776/v1/3456/flavors/1");
- FlavorApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/flavor_get.json")).build()
- ).getFlavorApiForZone("RegionOne");
-
- Flavor flavor = api.get(1);
- assertEquals(flavor.getName(), "512MB Instance");
- assertEquals(flavor.getId(), 1);
- assertEquals(flavor.getRam(), 512);
- assertEquals(flavor.getLinks().size(), 2);
- }
-
- public void testGetFlavorByAccountId() {
- URI endpoint = URI.create("http://172.16.0.1:8776/v1/3456/flavors/40806637803162");
- RedDwarfApi redDwarfApi = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/flavor_list.json")).build() );
- FlavorApi api = redDwarfApi.getFlavorApiForZone("RegionOne");
-
- Set<? extends Flavor> flavors = api.list( redDwarfApi.getCurrentTenantId().get().getId() ).toSet();
- Flavor flavor = flavors.iterator().next();
- assertEquals(flavor.getName(), "512MB Instance");
- assertEquals(flavor.getId(), 1);
- assertEquals(flavor.getRam(), 512);
- assertEquals(flavor.getLinks().size(), 2);
- }
-
- public void testGetFlavorFail() {
- URI endpoint = URI.create("http://172.16.0.1:8776/v1/3456/flavors/12312");
- FlavorApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(404).build()
- ).getFlavorApiForZone("RegionOne");
-
- assertNull(api.get(12312));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiLiveTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiLiveTest.java
deleted file mode 100644
index 62e0b1c..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/features/FlavorApiLiveTest.java
+++ /dev/null
@@ -1,87 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-import org.jclouds.openstack.reddwarf.v1.domain.Flavor;
-import org.jclouds.openstack.reddwarf.v1.internal.BaseRedDwarfApiLiveTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-import com.google.common.collect.FluentIterable;
-
-/**
- * @author Zack Shoylev
- */
-@Test(groups = "live", testName = "FlavorApiLiveTest")
-public class FlavorApiLiveTest extends BaseRedDwarfApiLiveTest {
-
- @Override
- @BeforeClass(groups = { "integration", "live" })
- public void setup() {
- super.setup();
- }
-
- private void checkFlavor(Flavor flavor) {
- assertNotNull(flavor.getId(), "Id cannot be null for " + flavor);
- assertNotNull(flavor.getName(), "Name cannot be null for " + flavor);
- }
-
- @Test
- public void testListFlavorsByAccount() {
- for (String zone : api.getConfiguredZones()) {
- FlavorApi flavorApi = api.getFlavorApiForZone(zone);
-
- FluentIterable<Flavor> response = flavorApi.list( api.getCurrentTenantId().get().getId() ); // tenant id, but referred to as account id.
- for (Flavor flavor : response) {
- checkFlavor(flavor);
- }
- }
- }
-
- @Test
- public void testListFlavorsByAccountWhenAccountIdNotFound() {
- for (String zone : api.getConfiguredZones()) {
- FlavorApi flavorApi = api.getFlavorApiForZone(zone);
- assertTrue(flavorApi.list("9999").isEmpty());
- }
- }
-
- @Test
- public void testGetFlavor() {
- for (String zone : api.getConfiguredZones()) {
- FlavorApi flavorApi = api.getFlavorApiForZone(zone);
- for (Flavor flavor : flavorApi.list()) {
- Flavor flavorFromGet = flavorApi.get(flavor.getId());
- assertEquals(flavorFromGet.getId(), flavor.getId());
- assertEquals(flavorFromGet.getRam(), flavor.getRam());
- assertEquals(flavorFromGet.getName(), flavor.getName());
- assertEquals(flavorFromGet.getLinks(), flavor.getLinks());
- }
- }
- }
-
- @Test
- public void testGetFlavorWhenNotFound() {
- for (String zone : api.getConfiguredZones()) {
- FlavorApi flavorApi = api.getFlavorApiForZone(zone);
- assertNull(flavorApi.get(9999));
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiExpectTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiExpectTest.java
deleted file mode 100644
index a257acb..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiExpectTest.java
+++ /dev/null
@@ -1,27 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.internal;
-
-import org.jclouds.openstack.reddwarf.v1.RedDwarfApi;
-
-/**
- * Base class for writing Flavor Rest Api Expect tests
- *
- * @author Everett Toews
- */
-public class BaseRedDwarfApiExpectTest extends BaseRedDwarfExpectTest<RedDwarfApi> {
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiLiveTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiLiveTest.java
deleted file mode 100644
index bec1a50..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfApiLiveTest.java
+++ /dev/null
@@ -1,43 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.internal;
-
-import java.util.Properties;
-
-import org.jclouds.apis.BaseApiLiveTest;
-import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
-import org.jclouds.openstack.reddwarf.v1.RedDwarfApi;
-
-/**
- * Tests behavior of RedDwarfApi
- *
- * @author Zack Shoylev
- */
-public class BaseRedDwarfApiLiveTest extends BaseApiLiveTest<RedDwarfApi> {
-
- public BaseRedDwarfApiLiveTest() {
- provider = "openstack-reddwarf";
- }
-
- @Override
- protected Properties setupProperties() {
- Properties props = super.setupProperties();
- setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
- setIfTestSystemPropertyPresent(props, KeystoneProperties.SERVICE_TYPE);
- return props;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfExpectTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfExpectTest.java
deleted file mode 100644
index 9ecb07d..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/internal/BaseRedDwarfExpectTest.java
+++ /dev/null
@@ -1,71 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.internal;
-
-import javax.ws.rs.core.MediaType;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-/**
- * Base class for writing Nova Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseRedDwarfExpectTest<T> extends BaseRestApiExpectTest<T> {
- protected HttpRequest keystoneAuthWithUsernameAndPassword;
- protected HttpRequest keystoneAuthWithUsernameAndPasswordAndTenantName;
- protected HttpRequest keystoneAuthWithAccessKeyAndSecretKeyAndTenantName;
- protected String authToken;
- protected HttpResponse responseWithKeystoneAccess;
- protected HttpRequest extensionsOfNovaRequest;
- protected HttpResponse extensionsOfNovaResponse;
- protected HttpResponse unmatchedExtensionsOfNovaResponse;
- protected HttpRequest keystoneAuthWithAccessKeyAndSecretKeyAndTenantId;
- protected String identityWithTenantId;
-
- public BaseRedDwarfExpectTest() {
- provider = "openstack-reddwarf";
- keystoneAuthWithUsernameAndPassword = KeystoneFixture.INSTANCE.initialAuthWithUsernameAndPassword(identity,
- credential);
- keystoneAuthWithUsernameAndPasswordAndTenantName = KeystoneFixture.INSTANCE.initialAuthWithUsernameAndPasswordAndTenantName(identity,
- credential);
- keystoneAuthWithAccessKeyAndSecretKeyAndTenantName = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantName(identity,
- credential);
- keystoneAuthWithAccessKeyAndSecretKeyAndTenantId = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantId(identity,
- credential);
-
- authToken = KeystoneFixture.INSTANCE.getAuthToken();
- responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess();
- // now, createContext arg will need tenant prefix
- identityWithTenantId = KeystoneFixture.INSTANCE.getTenantId() + ":" + identity;
- identity = KeystoneFixture.INSTANCE.getTenantName() + ":" + identity;
- }
-
- @Override
- protected HttpRequestComparisonType compareHttpRequestAsType(HttpRequest input) {
- return HttpRequestComparisonType.JSON;
- }
-
- protected HttpRequest.Builder<?> authenticatedGET() {
- return HttpRequest.builder()
- .method("GET")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/parse/ParseFlavorListTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/parse/ParseFlavorListTest.java b/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/parse/ParseFlavorListTest.java
deleted file mode 100644
index 836cc56..0000000
--- a/openstack/openstack-reddwarf/src/test/java/org/jclouds/openstack/reddwarf/v1/parse/ParseFlavorListTest.java
+++ /dev/null
@@ -1,108 +0,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.
- */
-package org.jclouds.openstack.reddwarf.v1.parse;
-
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.Uris;
-import org.jclouds.json.BaseSetParserTest;
-import org.jclouds.openstack.reddwarf.v1.domain.Flavor;
-import org.jclouds.openstack.v2_0.domain.Link;
-import org.jclouds.openstack.v2_0.domain.Link.Relation;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Zack Shoylev
- */
-
-@Test(groups = "unit", testName = "ParseFlavorTest")
-public class ParseFlavorListTest extends BaseSetParserTest<Flavor> {
-
- @Override
- public String resource() {
- return "/flavor_list.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- @SelectJson("flavors")
- public Set<Flavor> expected() {
- return ImmutableSet
- .of(Flavor.builder()
- .id(1)
- .name("512MB Instance")
- .ram(512)
- .links(ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("https://localhost:8778/v1.0/811050/flavors/1").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("https://localhost:8778/flavors/1").build() )
- ))
- .build(),
- Flavor.builder()
- .id(2)
- .name("1GB Instance")
- .ram(1024)
- .links(ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("https://localhost:8778/v1.0/811050/flavors/2").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("https://localhost:8778/flavors/2").build() )
- ))
- .build(),
- Flavor.builder()
- .id(3)
- .name("2GB Instance")
- .ram(2048)
- .links(ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("https://localhost:8778/v1.0/811050/flavors/3").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("https://localhost:8778/flavors/3").build() )
- ))
- .build(),
- Flavor.builder()
- .id(4)
- .name("4GB Instance")
- .ram(4096)
- .links(ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("https://localhost:8778/v1.0/811050/flavors/4").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("https://localhost:8778/flavors/4").build() )
- ))
- .build(),
- Flavor.builder()
- .id(5)
- .name("8GB Instance")
- .ram(8192)
- .links(ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("https://localhost:8778/v1.0/811050/flavors/5").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("https://localhost:8778/flavors/5").build() )
- ))
- .build(),
- Flavor.builder()
- .id(6)
- .name("16GB Instance")
- .ram(16384)
- .links(ImmutableList.of(
- Link.create(Relation.SELF, Uris.uriBuilder("https://localhost:8778/v1.0/811050/flavors/6").build() ),
- Link.create(Relation.BOOKMARK, Uris.uriBuilder("https://localhost:8778/flavors/6").build() )
- ))
- .build());
- }
-}
[4/6] Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApi.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApi.java
deleted file mode 100644
index 02ac8d3..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApi.java
+++ /dev/null
@@ -1,72 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0;
-
-import java.util.Set;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Zone;
-import org.jclouds.location.functions.ZoneToEndpoint;
-import org.jclouds.openstack.quantum.v1_0.features.NetworkApi;
-import org.jclouds.openstack.quantum.v1_0.features.PortApi;
-import org.jclouds.openstack.v2_0.features.ExtensionApi;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-
-import com.google.inject.Provides;
-
-import java.io.Closeable;
-
-/**
- * Provides access to Quantum.
- * <p/>
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content">api doc</a>
- */
-public interface QuantumApi extends Closeable {
- /**
- * @return the Zone codes configured
- */
- @Provides
- @Zone
- Set<String> getConfiguredZones();
-
- /**
- * Provides access to Extension features.
- */
- @Delegate
- ExtensionApi getExtensionApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides access to Network features.
- */
- @Delegate
- NetworkApi getNetworkApiForZone(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides access to Port features.
- */
- @Delegate
- @Path("/networks/{net}")
- PortApi getPortApiForZoneAndNetwork(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone,
- @PathParam("net") String networkId);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadata.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadata.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadata.java
deleted file mode 100644
index de79814..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadata.java
+++ /dev/null
@@ -1,91 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0;
-
-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.apis.ApiMetadata;
-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.quantum.v1_0.config.QuantumHttpApiModule;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for Quantum 1.0 API
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- */
-public class QuantumApiMetadata extends BaseHttpApiMetadata<QuantumApi> {
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public QuantumApiMetadata() {
- this(new Builder());
- }
-
- protected QuantumApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK);
- properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<QuantumApi, Builder> {
-
- protected Builder() {
- id("openstack-quantum")
- .name("OpenStack Quantum API")
- .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
- .credentialName("${password}")
- .endpointName("KeyStone base url ending in /v2.0/")
- .documentation(URI.create("http://docs.openstack.org/api/openstack-network/1.0/content/"))
- .version("1.0")
- .defaultEndpoint("http://localhost:5000/v2.0/")
- .defaultProperties(QuantumApiMetadata.defaultProperties())
- .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
- .add(AuthenticationApiModule.class)
- .add(KeystoneAuthenticationModule.class)
- .add(ZoneModule.class)
- .add(QuantumHttpApiModule.class).build());
- }
-
- @Override
- public QuantumApiMetadata build() {
- return new QuantumApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumHttpApiModule.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumHttpApiModule.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumHttpApiModule.java
deleted file mode 100644
index 384f6b2..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumHttpApiModule.java
+++ /dev/null
@@ -1,85 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.config;
-
-import java.net.URI;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import javax.inject.Provider;
-import javax.inject.Singleton;
-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.json.config.GsonModule.DateAdapter;
-import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
-import org.jclouds.openstack.quantum.v1_0.QuantumApi;
-import org.jclouds.openstack.quantum.v1_0.handlers.QuantumErrorHandler;
-import org.jclouds.openstack.v2_0.domain.Extension;
-import org.jclouds.openstack.v2_0.functions.PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.config.HttpApiModule;
-import org.jclouds.rest.functions.ImplicitOptionalConverter;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.Multimap;
-import com.google.inject.Provides;
-
-/**
- * Configures the Quantum connection.
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- */
-@ConfiguresHttpApi
-public class QuantumHttpApiModule extends HttpApiModule<QuantumApi> {
-
- @Override
- protected void configure() {
- bind(DateAdapter.class).to(Iso8601DateAdapter.class);
- bind(ImplicitOptionalConverter.class).to(PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.class);
- super.configure();
- }
-
- @Provides
- @Singleton
- public Multimap<URI, URI> aliases() {
- return ImmutableMultimap.<URI, URI>builder()
- .build();
- }
-
- @Provides
- @Singleton
- public LoadingCache<String, Set<? extends Extension>> provideExtensionsByZone(final Provider<QuantumApi> quantumApi) {
- return CacheBuilder.newBuilder().expireAfterWrite(23, TimeUnit.HOURS)
- .build(new CacheLoader<String, Set<? extends Extension>>() {
- @Override
- public Set<? extends Extension> load(String key) throws Exception {
- return quantumApi.get().getExtensionApiForZone(key).list();
- }
- });
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(QuantumErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(QuantumErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(QuantumErrorHandler.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumProperties.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumProperties.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumProperties.java
deleted file mode 100644
index 48e7dec..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/config/QuantumProperties.java
+++ /dev/null
@@ -1,26 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.config;
-
-/**
- * Configuration properties and constants used in openstack Quantum connections.
- *
- * @author Adam Lowe
- */
-public class QuantumProperties {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Attachment.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Attachment.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Attachment.java
deleted file mode 100644
index 42d41b5..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Attachment.java
+++ /dev/null
@@ -1,63 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.domain;
-
-import java.beans.ConstructorProperties;
-
-/**
- * A Quantum attachment
- *
- * @author Adam Lowe
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content/Attachments.html">api doc</a>
-*/
-public class Attachment extends Reference {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromAttachment(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Reference.Builder<T> {
-
- public Attachment build() {
- return new Attachment(id);
- }
-
- public T fromAttachment(Attachment in) {
- return super.fromReference(in);
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
-
- @ConstructorProperties({
- "id"
- })
- protected Attachment(String id) {
- super(id);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Network.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Network.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Network.java
deleted file mode 100644
index 6012b09..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Network.java
+++ /dev/null
@@ -1,102 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * A Quantum network
- *
- * @author Adam Lowe
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content/Networks.html">api doc</a>
-*/
-public class Network extends Reference {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromNetwork(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Reference.Builder<T> {
- protected String name;
-
- /**
- * @see Network#getName()
- */
- public T name(String name) {
- this.name = name;
- return self();
- }
-
- public Network build() {
- return new Network(id, name);
- }
-
- public T fromNetwork(Network in) {
- return super.fromReference(in)
- .name(in.getName());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final String name;
-
- @ConstructorProperties({
- "id", "name"
- })
- protected Network(String id, String name) {
- super(id);
- this.name = checkNotNull(name, "name");
- }
-
- public String getName() {
- return this.name;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), name);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- Network that = Network.class.cast(obj);
- return super.equals(that) && Objects.equal(this.name, that.name);
- }
-
- protected ToStringHelper string() {
- return super.string()
- .add("name", name);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/NetworkDetails.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/NetworkDetails.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/NetworkDetails.java
deleted file mode 100644
index 54808d0..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/NetworkDetails.java
+++ /dev/null
@@ -1,108 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-import java.util.Set;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Details of a Quantum network
- *
- * @author Adam Lowe
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content/Networks.html">api doc</a>
-*/
-public class NetworkDetails extends Network {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromNetworkDetails(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Network.Builder<T> {
- protected Set<Port> ports = ImmutableSet.of();
-
- /**
- * @see NetworkDetails#getPorts()
- */
- public T ports(Set<Port> ports) {
- this.ports = ImmutableSet.copyOf(checkNotNull(ports, "ports"));
- return self();
- }
-
- public T ports(Port... in) {
- return ports(ImmutableSet.copyOf(in));
- }
-
- public NetworkDetails build() {
- return new NetworkDetails(id, name, ports);
- }
-
- public T fromNetworkDetails(NetworkDetails in) {
- return super.fromNetwork(in)
- .ports(in.getPorts());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final Set<Port> ports;
-
- @ConstructorProperties({
- "id", "name", "ports"
- })
- protected NetworkDetails(String id, String name, Set<Port> ports) {
- super(id, name);
- this.ports = ImmutableSet.copyOf(checkNotNull(ports, "ports"));
- }
-
- public Set<Port> getPorts() {
- return this.ports;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(ports);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- NetworkDetails that = NetworkDetails.class.cast(obj);
- return super.equals(that) && Objects.equal(this.ports, that.ports);
- }
-
- protected ToStringHelper string() {
- return super.string()
- .add("ports", ports);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Port.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Port.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Port.java
deleted file mode 100644
index 53c5fc4..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Port.java
+++ /dev/null
@@ -1,108 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * A Quantum port
- *
- * @author Adam Lowe
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content/Ports.html">api doc</a>
-*/
-public class Port extends Reference {
-
- /**
- */
- public static enum State {
- ACTIVE, DOWN
- }
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromPort(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Reference.Builder<T> {
- protected Port.State state;
-
- /**
- * @see Port#getState()
- */
- public T state(Port.State state) {
- this.state = state;
- return self();
- }
-
- public Port build() {
- return new Port(id, state);
- }
-
- public T fromPort(Port in) {
- return super.fromReference(in)
- .state(in.getState());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final Port.State state;
-
- @ConstructorProperties({
- "id", "state"
- })
- protected Port(String id, Port.State state) {
- super(id);
- this.state = checkNotNull(state, "state");
- }
-
- public Port.State getState() {
- return this.state;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(state);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- Port that = Port.class.cast(obj);
- return super.equals(that) && Objects.equal(this.state, that.state);
- }
-
- protected ToStringHelper string() {
- return super.string()
- .add("state", state);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/PortDetails.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/PortDetails.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/PortDetails.java
deleted file mode 100644
index d02275e..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/PortDetails.java
+++ /dev/null
@@ -1,103 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.domain;
-
-import java.beans.ConstructorProperties;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * Details of a Quantum Port
- *
- * @author Adam Lowe
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content/Ports.html">api doc</a>
-*/
-public class PortDetails extends Port {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromPortDetails(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Port.Builder<T> {
- protected Attachment attachment;
-
- /**
- * @see PortDetails#getAttachment()
- */
- public T attachment(Attachment attachment) {
- this.attachment = attachment;
- return self();
- }
-
- public PortDetails build() {
- return new PortDetails(id, state, attachment);
- }
-
- public T fromPortDetails(PortDetails in) {
- return super.fromPort(in)
- .attachment(in.getAttachment());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final Attachment attachment;
-
- @ConstructorProperties({
- "id", "state", "attachment"
- })
- protected PortDetails(String id, Port.State state, @Nullable Attachment attachment) {
- super(id, state);
- this.attachment = attachment;
- }
-
- @Nullable
- public Attachment getAttachment() {
- return this.attachment;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(attachment);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- PortDetails that = PortDetails.class.cast(obj);
- return super.equals(that) && Objects.equal(this.attachment, that.attachment);
- }
-
- protected ToStringHelper string() {
- return super.string()
- .add("attachment", attachment);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Reference.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Reference.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Reference.java
deleted file mode 100644
index 9b34bd6..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/domain/Reference.java
+++ /dev/null
@@ -1,108 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * A wrapper around an id in the quantum api
- *
- * @author Adam Lowe
- * @see <a href="http://docs.openstack.org/api/openstack-network/1.0/content/Networks.html">api doc</a>
-*/
-public class Reference {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromReference(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> {
- protected abstract T self();
-
- protected String id;
-
- /**
- * @see Reference#getId()
- */
- public T id(String id) {
- this.id = id;
- return self();
- }
-
- public Reference build() {
- return new Reference(id);
- }
-
- public T fromReference(Reference in) {
- return this
- .id(in.getId());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- private final String id;
-
- @ConstructorProperties({
- "id"
- })
- protected Reference(String id) {
- this.id = checkNotNull(id, "id");
- }
-
- public String getId() {
- return this.id;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- Reference that = Reference.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- protected ToStringHelper string() {
- return Objects.toStringHelper(this)
- .add("id", id);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApi.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApi.java
deleted file mode 100644
index 5076687..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApi.java
+++ /dev/null
@@ -1,122 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.features;
-
-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.Produces;
-import javax.ws.rs.core.MediaType;
-import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.quantum.v1_0.domain.Network;
-import org.jclouds.openstack.quantum.v1_0.domain.NetworkDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Reference;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.WrapWith;
-
-import com.google.common.collect.FluentIterable;
-
-/**
- * Provides synchronous access to Network operations on the openstack quantum API.
- * <p/>
- * Each tenant can define one or more networks. A network is a virtual isolated layer-2 broadcast domain reserved to the
- * tenant. A tenant can create several ports for a network, and plug virtual interfaces into these ports.
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- * @see <a href=
- * "http://docs.openstack.org/api/openstack-network/1.0/content/Networks.html">api doc</a>
- */
-
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/networks")
-public interface NetworkApi {
-
- /**
- * Returns the list of all networks currently defined in Quantum for the current tenant. The list provides the unique
- * identifier of each network configured for the tenant.
- */
- @GET
- @SelectJson("networks")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<? extends Reference> listReferences();
-
- /**
- * Returns all networks currently defined in Quantum for the current tenant.
- */
- @GET
- @SelectJson("networks")
- @Path("/detail")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<? extends Network> list();
-
- /**
- * Returns the specific network.
- */
- @GET
- @SelectJson("network")
- @Path("/{id}")
- @Fallback(NullOnNotFoundOr404.class)
- Network get(@PathParam("id") String id);
-
- /**
- * Returns the details of the specific network.
- */
- @GET
- @SelectJson("network")
- @Path("/{id}/detail")
- @Fallback(NullOnNotFoundOr404.class)
- NetworkDetails getDetails(@PathParam("id") String id);
-
- /**
- * Create a new network with the specified symbolic name
- */
- @POST
- @SelectJson("network")
- @Produces(MediaType.APPLICATION_JSON)
- @WrapWith("network")
- Reference create(@PayloadParam("name") String name);
-
- /**
- * Adjusts the symbolic name of a network
- *
- * @param id the id of the Network to modify
- * @param name the new name for the Network
- */
- @PUT
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/{id}")
- @WrapWith("network")
- boolean rename(@PathParam("id") String id, @PayloadParam("name") String name);
-
- /**
- * Deletes the specified network
- */
- @DELETE
- @Path("/{id}")
- boolean delete(@PathParam("id") String id);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/PortApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/PortApi.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/PortApi.java
deleted file mode 100644
index 209449e..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/features/PortApi.java
+++ /dev/null
@@ -1,147 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.features;
-
-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.EmptyFluentIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.quantum.v1_0.domain.Attachment;
-import org.jclouds.openstack.quantum.v1_0.domain.Port;
-import org.jclouds.openstack.quantum.v1_0.domain.PortDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Reference;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.WrapWith;
-
-import com.google.common.collect.FluentIterable;
-
-/**
- * Provides synchronous access to Port operations on the openstack quantum API.
- * <p/>
- * A port represents a virtual switch port on a logical network switch where all the interfaces attached to a given network are connected.
- * <p/>
- * A port has an administrative state which is either 'DOWN' or 'ACTIVE'. Ports which are administratively down will not be able to receive/send traffic.
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- * @see <a href=
- * "http://docs.openstack.org/api/openstack-network/1.0/content/Ports.html">api doc</a>
- */
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/ports")
-public interface PortApi {
- /**
- * Returns the list of all ports currently defined in Quantum for the requested network
- */
- @GET
- @SelectJson("ports")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<? extends Reference> listReferences();
-
- /**
- * Returns the set of ports currently defined in Quantum for the requested network.
- */
- @GET
- @SelectJson("ports")
- @Path("/detail")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<? extends Port> list();
-
- /**
- * Returns a specific port.
- */
- @GET
- @SelectJson("port")
- @Path("/{id}")
- @Fallback(NullOnNotFoundOr404.class)
- Port get(@PathParam("id") String id);
-
- /**
- * Returns a specific port in detail.
- */
- @GET
- @SelectJson("port")
- @Consumes(MediaType.APPLICATION_JSON)
- @Path("/{id}/detail")
- @Fallback(NullOnNotFoundOr404.class)
- PortDetails getDetails(@PathParam("id") String id);
-
- /**
- * Create a new port on the specified network
- */
- @POST
- @SelectJson("port")
- Reference create();
-
- /**
- * Create a new port on the specified network, with the requested state
- */
- @POST
- @SelectJson("port")
- @WrapWith("port")
- Reference create(@PayloadParam("state") Port.State state);
-
- /**
- * Updates the state of a port
- */
- @PUT
- @Path("/{id}")
- @WrapWith("port")
- boolean updateState(@PathParam("id") String id, @PayloadParam("state") Port.State state);
-
- /**
- * Deletes a port from a network
- */
- @DELETE
- @Path("/{id}")
- boolean delete(@PathParam("id") String id);
-
- /**
- * Returns the attachment for the specified port.
- */
- @GET
- @SelectJson("attachment")
- @Path("/{id}/attachment")
- @Fallback(NullOnNotFoundOr404.class)
- Attachment showAttachment(@PathParam("id") String portId);
-
- /**
- * Plugs an attachment into the specified port
- */
- @PUT
- @Path("/{id}/attachment")
- @WrapWith("attachment")
- boolean plugAttachment(@PathParam("id") String portId, @PayloadParam("id") String attachmentId);
-
- /**
- * Unplugs the attachment currently plugged into the specified port
- */
- @DELETE
- @Path("{id}/attachment")
- boolean unplugAttachment(@PathParam("id") String portId);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/handlers/QuantumErrorHandler.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/handlers/QuantumErrorHandler.java b/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/handlers/QuantumErrorHandler.java
deleted file mode 100644
index f0845de..0000000
--- a/openstack/openstack-quantum/src/main/java/org/jclouds/openstack/quantum/v1_0/handlers/QuantumErrorHandler.java
+++ /dev/null
@@ -1,63 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.handlers;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-
-import javax.inject.Singleton;
-
-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 org.jclouds.rest.ResourceNotFoundException;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- *
- * @author Adam Lowe
- *
- */
-// TODO: is there error spec someplace? let's type errors, etc.
-@Singleton
-public class QuantumErrorHandler 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);
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 400:
- break;
- case 401:
- case 403:
- exception = new AuthorizationException(message, exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- exception = new ResourceNotFoundException(message, exception);
- }
- break;
- }
- command.setException(exception);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/openstack/openstack-quantum/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index ebd176c..0000000
--- a/openstack/openstack-quantum/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.openstack.quantum.v1_0.QuantumApiMetadata
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadataTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadataTest.java
deleted file mode 100644
index 888f03f..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/QuantumApiMetadataTest.java
+++ /dev/null
@@ -1,35 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0;
-
-import org.jclouds.View;
-import org.jclouds.apis.internal.BaseApiMetadataTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "QuantumApiMetadataTest")
-public class QuantumApiMetadataTest extends BaseApiMetadataTest {
- public QuantumApiMetadataTest() {
- super(new QuantumApiMetadata(), ImmutableSet.<TypeToken<? extends View>> of());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiExpectTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiExpectTest.java
deleted file mode 100644
index 7b19d6b..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiExpectTest.java
+++ /dev/null
@@ -1,235 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.quantum.v1_0.domain.Network;
-import org.jclouds.openstack.quantum.v1_0.domain.NetworkDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Reference;
-import org.jclouds.openstack.quantum.v1_0.internal.BaseQuantumApiExpectTest;
-import org.jclouds.openstack.quantum.v1_0.parse.ParseNetworkDetailsTest;
-import org.jclouds.openstack.quantum.v1_0.parse.ParseNetworkTest;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Tests parsing and Guice wiring of NetworkApi
- *
- * @author Adam Lowe
- */
-@Test(groups="unit", testName = "NetworkApiExpectTest")
-public class NetworkApiExpectTest extends BaseQuantumApiExpectTest {
-
- public void testListReferencesReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/list_network_refs.json", APPLICATION_JSON)).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- Set<? extends Reference> nets = api.listReferences().toSet();
- assertEquals(nets, listOfNetworkRefs());
- }
-
- public void testListReferencesReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks").build(),
- HttpResponse.builder().statusCode(404).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- assertTrue(api.listReferences().isEmpty());
- }
-
- public void testListReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/detail").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/list_networks.json", APPLICATION_JSON)).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- Set<? extends Network> nets = api.list().toSet();
- assertEquals(nets, listOfNetworks());
- }
-
- public void testListReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/detail").build(),
- HttpResponse.builder().statusCode(404).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- assertTrue(api.list().isEmpty());
- }
-
- public void testShowReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/network.json", APPLICATION_JSON)).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- Network net = api.get("16dba3bc-f3fa-4775-afdc-237e12c72f6a");
- assertEquals(net, new ParseNetworkTest().expected());
- }
-
- public void testShowReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
- HttpResponse.builder().statusCode(404).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- assertNull(api.get("16dba3bc-f3fa-4775-afdc-237e12c72f6a"));
- }
-
- public void testShowDetailsReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/detail").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/network_details.json", APPLICATION_JSON)).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- NetworkDetails net = api.getDetails("16dba3bc-f3fa-4775-afdc-237e12c72f6a");
- assertEquals(net, new ParseNetworkDetailsTest().expected());
- }
-
- public void testShowDetailsReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/detail").build(),
- HttpResponse.builder().statusCode(404).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- assertNull(api.getDetails("16dba3bc-f3fa-4775-afdc-237e12c72f6a"));
- }
-
- public void testCreateReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks").method("POST")
- .payload(payloadFromStringWithContentType("{\"network\":{\"name\":\"another-test\"}}", MediaType.APPLICATION_JSON)).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"network\":{\"id\":\"12345\"}}", APPLICATION_JSON)).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- Reference net = api.create("another-test");
- assertEquals(net, Reference.builder().id("12345").build());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testCreateReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks").method("POST")
- .payload(payloadFromStringWithContentType("{\"network\":{\"name\":\"another-test\"}}", MediaType.APPLICATION_JSON)).build(),
- HttpResponse.builder().statusCode(401).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- api.create("another-test");
- }
-
- public void testUpdateReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/12345").method("PUT")
- .payload(payloadFromStringWithContentType("{\"network\":{\"name\":\"another-test\"}}", MediaType.APPLICATION_JSON)).build(),
- HttpResponse.builder().statusCode(200).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- assertTrue(api.rename("12345", "another-test"));
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testUpdateReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/12345").method("PUT")
- .payload(payloadFromStringWithContentType("{\"network\":{\"name\":\"another-test\"}}", MediaType.APPLICATION_JSON)).build(),
- HttpResponse.builder().statusCode(404).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- api.rename("12345", "another-test");
- }
-
- public void testDeleteReturns2xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/12345").method("DELETE").build(),
- HttpResponse.builder().statusCode(200).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- assertTrue(api.delete("12345"));
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testDeleteReturns4xx() {
- NetworkApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/12345").method("DELETE").build(),
- HttpResponse.builder().statusCode(403).build())
- .getNetworkApiForZone("region-a.geo-1");
-
- api.delete("12345");
- }
-
- protected Set<Reference> listOfNetworkRefs() {
- return ImmutableSet.of(
- Reference.builder().id("16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
- Reference.builder().id("1a104cf5-cb18-4d35-9407-2fd2646d9d0b").build(),
- Reference.builder().id("31083ae2-420d-48b2-ac98-9f7a4fd8dbdc").build(),
- Reference.builder().id("49c6d6fa-ff2a-459d-b975-75a8d31c9a89").build(),
- Reference.builder().id("5cb3d6f4-62cb-41c9-b964-ba7d9df79e4e").build(),
- Reference.builder().id("5d51d012-3491-4db7-b1b5-6f254015015d").build(),
- Reference.builder().id("5f9cf7dc-22ca-4097-8e49-1cc8b23faf17").build(),
- Reference.builder().id("6319ecad-6bff-48b2-9b53-02ede8cb7588").build(),
- Reference.builder().id("6ba4c788-661f-49ab-9bf8-5f10cbbb2f57").build(),
- Reference.builder().id("74ed170b-5069-4353-ab38-9719766dc57e").build(),
- Reference.builder().id("b71fcac1-e864-4031-8c5b-edbecd9ece36").build(),
- Reference.builder().id("c7681895-d84d-4650-9ca0-82c72036b855").build()
- );
- }
-
- protected Set<Network> listOfNetworks() {
- return ImmutableSet.of(
- Network.builder().name("jclouds-port-test").id("16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
- Network.builder().name("wibble").id("1a104cf5-cb18-4d35-9407-2fd2646d9d0b").build(),
- Network.builder().name("jclouds-test").id("31083ae2-420d-48b2-ac98-9f7a4fd8dbdc").build(),
- Network.builder().name("jclouds-test").id("49c6d6fa-ff2a-459d-b975-75a8d31c9a89").build(),
- Network.builder().name("wibble").id("5cb3d6f4-62cb-41c9-b964-ba7d9df79e4e").build(),
- Network.builder().name("jclouds-port-test").id("5d51d012-3491-4db7-b1b5-6f254015015d").build(),
- Network.builder().name("wibble").id("5f9cf7dc-22ca-4097-8e49-1cc8b23faf17").build(),
- Network.builder().name("jclouds-test").id("6319ecad-6bff-48b2-9b53-02ede8cb7588").build(),
- Network.builder().name("jclouds-port-test").id("6ba4c788-661f-49ab-9bf8-5f10cbbb2f57").build(),
- Network.builder().name("jclouds-test").id("74ed170b-5069-4353-ab38-9719766dc57e").build(),
- Network.builder().name("wibble").id("b71fcac1-e864-4031-8c5b-edbecd9ece36").build(),
- Network.builder().name("jclouds-port-test").id("c7681895-d84d-4650-9ca0-82c72036b855").build()
- );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiLiveTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiLiveTest.java
deleted file mode 100644
index 8cfe56a..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/NetworkApiLiveTest.java
+++ /dev/null
@@ -1,91 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.jclouds.openstack.quantum.v1_0.domain.Network;
-import org.jclouds.openstack.quantum.v1_0.domain.NetworkDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Reference;
-import org.jclouds.openstack.quantum.v1_0.internal.BaseQuantumApiLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * Tests NetworkApi
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- */
-@Test(groups = "live", testName = "NetworkApiLiveTest", singleThreaded = true)
-public class NetworkApiLiveTest extends BaseQuantumApiLiveTest {
-
- public void testListNetworks() {
- for (String zoneId : api.getConfiguredZones()) {
- Set<? extends Reference> ids = api.getNetworkApiForZone(zoneId).listReferences().toSet();
- Set<? extends Network> networks = api.getNetworkApiForZone(zoneId).list().toSet();
- assertNotNull(ids);
- assertEquals(ids.size(), networks.size());
- for (Network network : networks) {
- assertNotNull(network.getName());
- assertTrue(ids.contains(Reference.builder().id(network.getId()).build()));
- }
- }
- }
-
- public void testCreateUpdateAndDeleteNetwork() {
- for (String zoneId : api.getConfiguredZones()) {
- NetworkApi netApi = api.getNetworkApiForZone(zoneId);
- Reference net = netApi.create("jclouds-test");
- assertNotNull(net);
-
- Network network = netApi.get(net.getId());
- NetworkDetails details = netApi.getDetails(net.getId());
-
- for(Network checkme : ImmutableList.of(network, details)) {
- assertEquals(checkme.getId(), net.getId());
- assertEquals(checkme.getName(), "jclouds-test");
- }
-
- assertTrue(details.getPorts().isEmpty());
-
- assertTrue(netApi.rename(net.getId(), "jclouds-live-test"));
-
- // Grab the updated metadata
- network = netApi.get(net.getId());
- details = netApi.getDetails(net.getId());
-
- for(Network checkme : ImmutableList.of(network, details)) {
- assertEquals(checkme.getId(), net.getId());
- assertEquals(checkme.getName(), "jclouds-live-test");
- }
-
- assertTrue(details.getPorts().isEmpty());
-
- Reference net2 = netApi.create("jclouds-test2");
- assertNotNull(net2);
-
- assertTrue(netApi.delete(net.getId()));
- assertTrue(netApi.delete(net2.getId()));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiExpectTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiExpectTest.java
deleted file mode 100644
index 1c37b4a..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiExpectTest.java
+++ /dev/null
@@ -1,245 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.quantum.v1_0.domain.Attachment;
-import org.jclouds.openstack.quantum.v1_0.domain.Port;
-import org.jclouds.openstack.quantum.v1_0.domain.PortDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Reference;
-import org.jclouds.openstack.quantum.v1_0.internal.BaseQuantumApiExpectTest;
-import org.jclouds.openstack.quantum.v1_0.parse.ParsePortDetailsTest;
-import org.jclouds.openstack.quantum.v1_0.parse.ParsePortTest;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Tests parsing and Guice wiring of PortApi
- *
- * @author Adam Lowe
- */
-@Test(groups="unit", testName = "PortApiExpectTest")
-public class PortApiExpectTest extends BaseQuantumApiExpectTest {
-
- public void testListReferencesReturns2xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/1a104cf5-cb18-4d35-9407-2fd2646d9d0b/ports").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"ports\": [{\"id\": \"a6058a59-fa8c-46cc-bac8-08904e6ff0a5\"}]}", APPLICATION_JSON)).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "1a104cf5-cb18-4d35-9407-2fd2646d9d0b");
-
- Set<? extends Reference> nets = api.listReferences().toSet();
- assertEquals(nets, ImmutableSet.of(Reference.builder().id("a6058a59-fa8c-46cc-bac8-08904e6ff0a5").build()));
- }
-
- public void testListReferencesReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/1a104cf5-cb18-4d35-9407-2fd2646d9d0b/ports").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "1a104cf5-cb18-4d35-9407-2fd2646d9d0b");
-
- assertTrue(api.listReferences().isEmpty());
- }
-
- public void testListReturns2xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/1a104cf5-cb18-4d35-9407-2fd2646d9d0b/ports/detail").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"ports\": [{\"state\": \"DOWN\", \"id\": \"814ae4bb-33d9-425f-8ee2-13a5c90b1465\"}]}", APPLICATION_JSON)).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "1a104cf5-cb18-4d35-9407-2fd2646d9d0b");
-
- Set<? extends Port> nets = api.list().toSet();
- assertEquals(nets, ImmutableSet.of(Port.builder().state(Port.State.DOWN).id("814ae4bb-33d9-425f-8ee2-13a5c90b1465").build()));
- }
-
- public void testListReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/1a104cf5-cb18-4d35-9407-2fd2646d9d0b/ports/detail").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "1a104cf5-cb18-4d35-9407-2fd2646d9d0b");
-
- assertTrue(api.list().isEmpty());
- }
-
- public void testShowReturns2xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/646c123b-871a-4124-9fa2-a94f04a582df").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/port.json", APPLICATION_JSON)).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- Port port = api.get("646c123b-871a-4124-9fa2-a94f04a582df");
- assertEquals(port, new ParsePortTest().expected());
- }
-
- public void testShowReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/646c123b-871a-4124-9fa2-a94f04a582df").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- assertNull(api.get("646c123b-871a-4124-9fa2-a94f04a582df"));
- }
-
- public void testShowDetailsReturns2xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/646c123b-871a-4124-9fa2-a94f04a582df/detail").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/port_details.json", APPLICATION_JSON)).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- PortDetails net = api.getDetails("646c123b-871a-4124-9fa2-a94f04a582df");
- assertEquals(net, new ParsePortDetailsTest().expected());
- }
-
- public void testShowDetailsReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/646c123b-871a-4124-9fa2-a94f04a582df/detail").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- assertNull(api.getDetails("646c123b-871a-4124-9fa2-a94f04a582df"));
- }
-
- public void testCreateReturns2xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports").method("POST").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"port\":{\"id\":\"12345\"}}", APPLICATION_JSON)).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- Reference port = api.create();
- assertEquals(port, Reference.builder().id("12345").build());
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testCreateReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports").method("POST").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- api.create();
- }
-
- public void testUpdateReturns2xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777").method("PUT")
- .payload(payloadFromStringWithContentType("{\"port\":{\"state\":\"ACTIVE\"}}", MediaType.APPLICATION_JSON)).build(),
- HttpResponse.builder().statusCode(200).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- assertTrue(api.updateState("77777", Port.State.ACTIVE));
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testUpdateReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777").method("PUT")
- .payload(payloadFromStringWithContentType("{\"port\":{\"state\":\"ACTIVE\"}}", MediaType.APPLICATION_JSON)).build(),
- HttpResponse.builder().statusCode(401).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- api.updateState("77777", Port.State.ACTIVE);
- }
-
- public void testShowAttachment() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/attachment.json", APPLICATION_JSON)).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- Attachment attachment = api.showAttachment("77777");
- assertEquals(attachment, Attachment.builder().id("jclouds-live-test").build());
- }
-
- public void testShowAttachmentReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- assertNull(api.showAttachment("77777"));
- }
-
- public void testPlugAttachment() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment")
- .payload(payloadFromStringWithContentType("{\"attachment\":{\"id\":\"jclouds-live-test\"}}", MediaType.APPLICATION_JSON))
- .method("PUT").build(),
- HttpResponse.builder().statusCode(200).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- assertTrue(api.plugAttachment("77777", "jclouds-live-test"));
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testPlugAttachmentReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment")
- .payload(payloadFromStringWithContentType("{\"attachment\":{\"id\":\"jclouds-live-test\"}}", MediaType.APPLICATION_JSON))
- .method("PUT").build(),
- HttpResponse.builder().statusCode(403).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- api.plugAttachment("77777", "jclouds-live-test");
- }
- public void testUnplugAttachment() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment").method("DELETE").build(),
- HttpResponse.builder().statusCode(200).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- assertTrue(api.unplugAttachment("77777"));
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testUnplugAttachmentReturns4xx() {
- PortApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
- authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment").method("DELETE").build(),
- HttpResponse.builder().statusCode(404).build())
- .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");
-
- api.unplugAttachment("77777");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiLiveTest.java b/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiLiveTest.java
deleted file mode 100644
index 4e0c2eb..0000000
--- a/openstack/openstack-quantum/src/test/java/org/jclouds/openstack/quantum/v1_0/features/PortApiLiveTest.java
+++ /dev/null
@@ -1,137 +0,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.
- */
-package org.jclouds.openstack.quantum.v1_0.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.jclouds.openstack.quantum.v1_0.domain.Attachment;
-import org.jclouds.openstack.quantum.v1_0.domain.NetworkDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Port;
-import org.jclouds.openstack.quantum.v1_0.domain.PortDetails;
-import org.jclouds.openstack.quantum.v1_0.domain.Reference;
-import org.jclouds.openstack.quantum.v1_0.internal.BaseQuantumApiLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-/**
- * Tests PortApi
- *
- * @author Adam Lowe
- * @author Zack Shoylev
- */
-@Test(groups = "live", testName = "PortApiLiveTest", singleThreaded = true)
-public class PortApiLiveTest extends BaseQuantumApiLiveTest {
-
- public void testListPorts() {
- for (String zoneId : api.getConfiguredZones()) {
- NetworkApi netApi = api.getNetworkApiForZone(zoneId);
- Set<? extends Reference> nets = netApi.listReferences().toSet();
- for(Reference net : nets) {
- PortApi portApi = api.getPortApiForZoneAndNetwork(zoneId, net.getId());
- Set<? extends Reference> portRefs = portApi.listReferences().toSet();
- Set<? extends Port> ports = portApi.list().toSet();
-
- assertEquals(portRefs.size(), ports.size());
- for (Port port : ports) {
- assertTrue(portRefs.contains(Reference.builder().id(port.getId()).build()));
- }
- }
- }
- }
-
- public void testCreateUpdateAndDeletePort() {
- for (String zoneId : api.getConfiguredZones()) {
- NetworkApi netApi = api.getNetworkApiForZone(zoneId);
- Reference net = netApi.create("jclouds-port-test");
- assertNotNull(net);
- PortApi portApi = api.getPortApiForZoneAndNetwork(zoneId, net.getId());
-
- Reference portRef = portApi.create();
- assertNotNull(portRef);
-
- Port port = portApi.get(portRef.getId());
- PortDetails portDetails = portApi.getDetails(portRef.getId());
- NetworkDetails networkDetails = netApi.getDetails(net.getId());
-
- assertEquals(port.getState(), portDetails.getState());
-
- for(Port checkme : ImmutableList.of(port, portDetails, Iterables.getOnlyElement(networkDetails.getPorts()))) {
- assertEquals(checkme.getId(), portRef.getId());
- }
-
- assertTrue(portApi.updateState(portRef.getId(), Port.State.DOWN));
-
- port = portApi.get(portRef.getId());
- portDetails = portApi.getDetails(portRef.getId());
-
- for(Port checkme : ImmutableList.of(port, portDetails)) {
- assertEquals(checkme.getId(), portRef.getId());
- assertEquals(checkme.getState(), Port.State.DOWN);
- }
-
- assertTrue(portApi.plugAttachment(port.getId(), "jclouds-live-test"));
-
- Attachment attachment = portApi.showAttachment(port.getId());
- portDetails = portApi.getDetails(portRef.getId());
-
- for(Attachment checkme : ImmutableList.of(attachment, portDetails.getAttachment())) {
- assertNotNull(checkme);
- assertEquals(checkme.getId(), "jclouds-live-test");
- }
-
- assertTrue(portApi.unplugAttachment(port.getId()));
-
- assertTrue(portApi.delete(portRef.getId()));
- assertTrue(netApi.delete(net.getId()));
- }
- }
-
- @Test(enabled=false) // assuming attachmentId matters in the wild
- public void testAttachAndDetachPort() {
- for (String zoneId : api.getConfiguredZones()) {
- NetworkApi netApi = api.getNetworkApiForZone(zoneId);
- Reference net = netApi.create("jclouds-attach-test");
- assertNotNull(net);
-
- PortApi portApi = api.getPortApiForZoneAndNetwork(zoneId, net.getId());
-
- Reference port = portApi.create();
- assertNotNull(port);
-
- assertTrue(portApi.plugAttachment(port.getId(), "jclouds-live-test"));
-
- Attachment attachment = portApi.showAttachment(port.getId());
- PortDetails portDetails = portApi.getDetails(port.getId());
-
- for(Attachment checkme : ImmutableList.of(attachment, portDetails.getAttachment())) {
- assertNotNull(checkme);
- assertEquals(checkme.getId(), "jclouds-live-test");
- }
-
- assertTrue(portApi.unplugAttachment(port.getId()));
-
- assertTrue(portApi.delete(port.getId()));
- assertTrue(netApi.delete(net.getId()));
- }
- }
-}
[5/6] Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java
deleted file mode 100644
index e070fe1..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java
+++ /dev/null
@@ -1,268 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.options;
-
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CONTAINER_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.DISK_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.IS_PUBLIC;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_DISK;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_RAM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.NAME;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.PROTECTED;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE_MAX;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE_MIN;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.STATUS;
-
-import java.util.Date;
-
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image.Status;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * <h2></h2>Usage</h2> The recommended way to instantiate a ListImageOptions object is to statically import
- * ListImageOptions.Builder.* and invoke a static creation method for each option as needed:
- * <p/>
- * <code>
- * import static org.jclouds.openstack.glance.v1_0.options.ListImageOptions.Builder.*
- *
- *
- * // this will list the first 10 images with the name "name", minimum required disk of 5GB.
- * list = api.list(name("newName"), limit(10), minDisk(5));
- * <code>
- *
- * @author Adam Lowe
- * @see <a href="http://glance.openstack.org/glanceapi.html"/>
- */
-public class ListImageOptions extends PaginationOptions {
- public static final ListImageOptions NONE = new ListImageOptions();
-
- /**
- * Return only those images having a matching name attribute
- */
- public ListImageOptions name(String name) {
- queryParameters.put(NAME.asParam(), name);
- return this;
- }
-
- /**
- * Return only those images that have the requested status
- */
- public ListImageOptions status(Status status) {
- queryParameters.put(STATUS.asParam(), status.toString());
- return this;
- }
-
- /**
- * Return only those images having a matching container format
- */
- public ListImageOptions containerFormat(ContainerFormat containerFormat) {
- queryParameters.put(CONTAINER_FORMAT.asParam(), containerFormat.toString());
- return this;
- }
-
- /**
- * Return only those images having a matching disk format
- */
- public ListImageOptions diskFormat(DiskFormat diskFormat) {
- queryParameters.put(DISK_FORMAT.asParam(), diskFormat.toString());
- return this;
- }
-
- /**
- * Return only those images having a matching min ram size
- */
- public ListImageOptions minRam(long ram) {
- queryParameters.put(MIN_RAM.asParam(), Long.toString(ram));
- return this;
- }
-
- /**
- * Return only those images having a matching min disk size
- */
- public ListImageOptions minDisk(long disk) {
- queryParameters.put(MIN_DISK.asParam(), Long.toString(disk));
- return this;
- }
-
- /**
- * Return those images that have a size attribute greater than or equal to size
- */
- public ListImageOptions minSize(long size) {
- queryParameters.put(SIZE_MIN.asParam(), Long.toString(size));
- return this;
- }
-
- /**
- * Return those images that have a size attribute less than or equal to size
- */
- public ListImageOptions maxSize(long size) {
- queryParameters.put(SIZE_MAX.asParam(), Long.toString(size));
- return this;
- }
-
- /**
- * Return only public images or only private images
- */
- public ListImageOptions isPublic(boolean isPublic) {
- queryParameters.put(IS_PUBLIC.asParam(), Boolean.toString(isPublic));
- return this;
- }
-
- /**
- * Filter to only protected or unprotected images
- */
- public ListImageOptions isProtected(boolean isProtected) {
- queryParameters.put(PROTECTED.asParam(), Boolean.toString(isProtected));
- return this;
- }
-
- /**
- * Results will be ordered by the specified image attribute.
- */
- public ListImageOptions sortBy(ImageField key) {
- queryParameters.put("sort_key", key.asParam());
- return this;
- }
-
- /**
- * Ascending sort order (smallest first).
- * <p/>
- * NOTE: default behavior is to sort descending (largest first)
- */
- public ListImageOptions sortAscending() {
- queryParameters.put("sort_dir", "asc");
- return this;
- }
-
- public static class Builder {
- /**
- * @see ListImageOptions#name
- */
- public static ListImageOptions name(String name) {
- return new ListImageOptions().name(name);
- }
-
- /**
- * @see ListImageOptions#diskFormat
- */
- public static ListImageOptions diskFormat(DiskFormat diskFormat) {
- return new ListImageOptions().diskFormat(diskFormat);
- }
-
- /**
- * @see ListImageOptions#containerFormat
- */
- public static ListImageOptions containerFormat(ContainerFormat containerFormat) {
- return new ListImageOptions().containerFormat(containerFormat);
- }
-
- /**
- * @see ListImageOptions#minRam
- */
- public static ListImageOptions minRam(long size) {
- return new ListImageOptions().minRam(size);
- }
-
-
- /**
- * @see ListImageOptions#minDisk
- */
- public static ListImageOptions minDisk(long size) {
- return new ListImageOptions().minDisk(size);
- }
-
- /**
- * @see ListImageOptions#minSize
- */
- public static ListImageOptions minSize(long size) {
- return new ListImageOptions().minSize(size);
- }
-
- /**
- * @see ListImageOptions#maxSize
- */
- public static ListImageOptions maxSize(long size) {
- return new ListImageOptions().maxSize(size);
- }
-
- /**
- * @see ListImageOptions#sortBy
- */
- public static ListImageOptions status(Status status) {
- return new ListImageOptions().status(status);
- }
-
- /**
- * @see ListImageOptions#sortBy
- */
- public static ListImageOptions sortBy(ImageField sortKey) {
- return new ListImageOptions().sortBy(sortKey);
- }
-
- /**
- * @see ListImageOptions#sortAscending
- */
- public static ListImageOptions sortAscending() {
- return new ListImageOptions().sortAscending();
- }
-
- /**
- * @see ListImageOptions#isPublic
- */
- public static ListImageOptions isPublic(boolean isPublic) {
- return ListImageOptions.class.cast(new ListImageOptions().isPublic(isPublic));
- }
-
- /**
- * @see ListImageOptions#isProtected
- */
- public static ListImageOptions isProtected(boolean isProtected) {
- return ListImageOptions.class.cast(new ListImageOptions().isProtected(isProtected));
- }
-
- /**
- * @see ListImageOptions#limit
- */
- public static ListImageOptions limit(int limit) {
- return new ListImageOptions().limit(limit);
- }
-
- /**
- * @see ListImageOptions#marker
- */
- public static ListImageOptions marker(String marker) {
- return new ListImageOptions().marker(marker);
- }
- }
-
- @Override
- public ListImageOptions changesSince(Date ifModifiedSince) {
- return ListImageOptions.class.cast(super.changesSince(ifModifiedSince));
- }
-
- @Override
- public ListImageOptions marker(String marker) {
- return ListImageOptions.class.cast(super.marker(marker));
- }
-
- @Override
- public ListImageOptions limit(int limit) {
- return ListImageOptions.class.cast(super.limit(limit));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java
deleted file mode 100644
index 5701b8d..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java
+++ /dev/null
@@ -1,253 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.options;
-
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CHECKSUM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CONTAINER_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.DISK_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.IS_PUBLIC;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.LOCATION;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_DISK;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_RAM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.NAME;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.OWNER;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.PROPERTY;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.PROTECTED;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.STORE;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.StoreType;
-
-/**
- * <h2></h2>Usage</h2> The recommended way to instantiate a UpdateImageOptions object is to statically import
- * UpdateImageOptions.Builder.* and invoke a static creation method for each option as needed:
- * <p/>
- * <code>
- * import static org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions.Builder.*
- *
- *
- * // this will adjust the image with id 'id' the name "newName", minimum required disk of 5GB, etc.
- * details = api.update(id, name("newName"), minDisk(5), isPublic(true), property("mykey", "somevalue"));
- * <code>
- * @author Adam Lowe
- * @see <a href="http://glance.openstack.org/glanceapi.html"/>
- */
-public class UpdateImageOptions extends BaseHttpRequestOptions {
-
- /**
- * Adjust the name of the image
- */
- public UpdateImageOptions name(String name) {
- headers.put(NAME.asHeader(), name);
- return this;
- }
-
- /**
- * When present, Glance will attempt to store the disk image data in the backing store indicated by the value of the
- * header. If the Glance node does not support the backing store, Glance will return a 400 Bad Request.
- */
- public UpdateImageOptions storeType(StoreType storeType) {
- headers.put(STORE.asHeader(), storeType.toString());
- return this;
- }
-
- public UpdateImageOptions diskFormat(DiskFormat diskFormat) {
- headers.put(DISK_FORMAT.asHeader(), diskFormat.toString());
- return this;
- }
-
- public UpdateImageOptions containerFormat(ContainerFormat containerFormat) {
- headers.put(CONTAINER_FORMAT.asHeader(), containerFormat.toString());
- return this;
- }
-
- /**
- * When present, Glance assumes that the expected size of the request body will be the value of this header. If the
- * length in bytes of the request body does not match the value of this header, Glance will return a 400 Bad Request.
- */
- public UpdateImageOptions size(long size) {
- headers.put(SIZE.asHeader(), Long.toString(size));
- return this;
- }
-
- /**
- * MD5 checksum of the image
- * <p/>
- * When present, Glance will verify the checksum generated from the backend store when storing your image against
- * this value and return a 400 Bad Request if the values do not match.
- */
- public UpdateImageOptions checksum(String checksum) {
- headers.put(CHECKSUM.asHeader(), checksum);
- return this;
- }
-
- public UpdateImageOptions location(String location) {
- headers.put(LOCATION.asHeader(), location);
- return this;
- }
-
- /**
- * Mark the image as public, meaning that any user may view its metadata and may read the disk image
- * from Glance.
- */
- public UpdateImageOptions isPublic(boolean isPublic) {
- headers.put(IS_PUBLIC.asHeader(), Boolean.toString(isPublic));
- return this;
- }
-
- /**
- * Mark the image as protected - if set to true the image cannot be deleted till it is unset.
- */
- public UpdateImageOptions isProtected(boolean isProtected) {
- headers.put(PROTECTED.asHeader(), Boolean.toString(isProtected));
- return this;
- }
-
- /**
- * The expected minimum ram required in megabytes to run this image on a server (default 0).
- */
- public UpdateImageOptions minRam(long ram) {
- headers.put(MIN_RAM.asHeader(), Long.toString(ram));
- return this;
- }
-
- /**
- * The expected minimum disk required in gigabytes to run this image on a server (default 0).
- */
- public UpdateImageOptions minDisk(long disk) {
- headers.put(MIN_DISK.asHeader(), Long.toString(disk));
- return this;
- }
-
- /**
- * Glance normally sets the owner of an image to be the tenant or user (depending on the “owner_is_tenant”
- * configuration option) of the authenticated user issuing the request. However, if the authenticated user has the
- * Admin role, this default may be overridden by setting this header to null or to a string identifying the owner of
- * the image.
- */
- public UpdateImageOptions owner(String owner) {
- headers.put(OWNER.asHeader(), owner);
- return this;
- }
-
- /**
- * Custom, free-form image properties stored with the image.
- */
- public UpdateImageOptions property(String key, String value) {
- if (!key.toLowerCase().startsWith(PROPERTY.asHeader() + "-")) {
- key = PROPERTY.asHeader() + "-" + key;
- }
- headers.put(key, value);
- return this;
- }
-
- public static class Builder {
- /**
- * @see UpdateImageOptions#name
- */
- public static UpdateImageOptions name(String name) {
- return new UpdateImageOptions().name(name);
- }
-
- /**
- * @see UpdateImageOptions#storeType
- */
- public static UpdateImageOptions storeType(StoreType storeType) {
- return new UpdateImageOptions().storeType(storeType);
- }
-
- /**
- * @see UpdateImageOptions#diskFormat
- */
- public static UpdateImageOptions diskFormat(DiskFormat diskFormat) {
- return new UpdateImageOptions().diskFormat(diskFormat);
- }
-
- /**
- * @see UpdateImageOptions#containerFormat
- */
- public static UpdateImageOptions containerFormat(ContainerFormat containerFormat) {
- return new UpdateImageOptions().containerFormat(containerFormat);
- }
-
- /**
- * @see UpdateImageOptions#size
- */
- public static UpdateImageOptions size(long size) {
- return new UpdateImageOptions().size(size);
- }
-
- /**
- * @see UpdateImageOptions#checksum
- */
- public static UpdateImageOptions checksum(String checksum) {
- return new UpdateImageOptions().checksum(checksum);
- }
-
- /**
- * @see UpdateImageOptions#location
- */
- public static UpdateImageOptions location(String location) {
- return new UpdateImageOptions().location(location);
- }
-
- /**
- * @see UpdateImageOptions#isPublic
- */
- public static UpdateImageOptions isPublic(boolean isPublic) {
- return new UpdateImageOptions().isPublic(isPublic);
- }
-
- /**
- * @see UpdateImageOptions#isProtected
- */
- public static UpdateImageOptions isProtected(boolean isProtected) {
- return new UpdateImageOptions().isProtected(isProtected);
- }
-
- /**
- * @see UpdateImageOptions#minRam
- */
- public static UpdateImageOptions minRam(long ram) {
- return new UpdateImageOptions().minRam(ram);
- }
-
- /**
- * @see UpdateImageOptions#minDisk
- */
- public static UpdateImageOptions minDisk(long disk) {
- return new UpdateImageOptions().minDisk(disk);
- }
-
- /**
- * @see UpdateImageOptions#owner
- */
- public static UpdateImageOptions owner(String owner) {
- return new UpdateImageOptions().owner(owner);
- }
-
- /**
- * @see UpdateImageOptions#property
- */
- public static UpdateImageOptions property(String key, String value) {
- return new UpdateImageOptions().property(key, value);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index c010366..0000000
--- a/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.openstack.glance.v1_0.GlanceApiMetadata
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java
deleted file mode 100644
index dd1b856..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java
+++ /dev/null
@@ -1,35 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0;
-
-import org.jclouds.View;
-import org.jclouds.apis.internal.BaseApiMetadataTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "GlanceApiMetadataTest")
-public class GlanceApiMetadataTest extends BaseApiMetadataTest {
- public GlanceApiMetadataTest() {
- super(new GlanceApiMetadata(), ImmutableSet.<TypeToken<? extends View>> of());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
deleted file mode 100644
index 7236aff..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
+++ /dev/null
@@ -1,420 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.features;
-
-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 javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.io.Payloads;
-import org.jclouds.io.payloads.StringPayload;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.glance.v1_0.functions.ParseImageDetailsFromHeadersTest;
-import org.jclouds.openstack.glance.v1_0.internal.BaseGlanceApiExpectTest;
-import org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions;
-import org.jclouds.openstack.glance.v1_0.parse.ParseImageDetailsTest;
-import org.jclouds.openstack.glance.v1_0.parse.ParseImagesInDetailTest;
-import org.jclouds.openstack.glance.v1_0.parse.ParseImagesTest;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * @author Adrian Cole
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ImageApiExpectTest")
-public class ImageApiExpectTest extends BaseGlanceApiExpectTest {
-
- public void testListWhenResponseIs2xx() throws Exception {
- HttpRequest list = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/images.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").list().concat().toString(),
- new ParseImagesTest().expected().toString());
- }
-
- public void testListWhenReponseIs404IsEmpty() throws Exception {
- HttpRequest list = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertTrue(apiWhenNoExist.getImageApiForZone("az-1.region-a.geo-1").list().concat().isEmpty());
- }
-
- public void testListInDetailWhenResponseIs2xx() throws Exception {
- HttpRequest listInDetail = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/detail")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse listInDetailResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/images_detail.json")).build();
-
- GlanceApi apiWhenExistInDetail = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, listInDetail, listInDetailResponse);
-
- assertEquals(apiWhenExistInDetail.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExistInDetail.getImageApiForZone("az-1.region-a.geo-1").listInDetail().concat().toString(),
- new ParseImagesInDetailTest().expected().toString());
- }
-
- public void testListInDetailWhenReponseIs404IsEmpty() throws Exception {
- HttpRequest listInDetail = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/detail")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse listInDetailResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExistInDetail = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, listInDetail, listInDetailResponse);
-
- assertTrue(apiWhenNoExistInDetail.getImageApiForZone("az-1.region-a.geo-1").listInDetail().concat().isEmpty());
- }
-
- public void testShowWhenResponseIs2xx() throws Exception {
- HttpRequest show = HttpRequest
- .builder()
- .method("HEAD")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse showResponse = new ParseImageDetailsFromHeadersTest().response;
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, show, showResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").get("fcc451d0-f6e4-4824-ad8f-70ec12326d07").toString(),
- new ParseImageDetailsFromHeadersTest().expected().toString());
- }
-
- public void testShowWhenReponseIs404IsNull() throws Exception {
- HttpRequest show = HttpRequest.builder().method("HEAD")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse showResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, show, showResponse);
-
- assertNull(apiWhenNoExist.getImageApiForZone("az-1.region-a.geo-1").get("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-
-
- public void testGetAsStreamWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(200).payload(Payloads.newStringPayload("foo")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(Strings2.toStringAndClose(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").getAsStream("fcc451d0-f6e4-4824-ad8f-70ec12326d07")),
- "foo");
- }
-
- public void testGetAsStreamWhenReponseIs404IsNull() throws Exception {
- HttpRequest get = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertNull(apiWhenNoExist.getImageApiForZone("az-1.region-a.geo-1").getAsStream("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-
- public void testCreateWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromStringWithContentType("somedata", MediaType.APPLICATION_OCTET_STREAM)).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").create("test", new StringPayload("somedata")),
- new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testCreateWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromStringWithContentType("somedata", MediaType.APPLICATION_OCTET_STREAM)).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(403)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").create("test", new StringPayload("somedata"));
- }
-
- public void testReserveWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").reserve("test"), new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testReserveWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(403)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").reserve("test");
- }
-
- public void testUpdateMetadataWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "newname")
- .put("X-Image-Meta-Is_public", "true")
- .put("X-Image-Meta-Protected", "true")
- .put("X-Image-Meta-Checksum", "XXXX")
- .put("X-Image-Meta-Location", "somewhere")
- .put("X-Image-Meta-Min_disk", "10")
- .put("X-Image-Meta-Min_ram", "2048")
- .put("X-Auth-Token", authToken).build())
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1")
- .update("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- UpdateImageOptions.Builder.name("newname"),
- UpdateImageOptions.Builder.isPublic(true),
- UpdateImageOptions.Builder.isProtected(true),
- UpdateImageOptions.Builder.checksum("XXXX"),
- UpdateImageOptions.Builder.location("somewhere"),
- UpdateImageOptions.Builder.minDisk(10),
- UpdateImageOptions.Builder.minRam(2048)),
- new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testUpdateMetadataWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "newname")
- .put("X-Image-Meta-Is_public", "true")
- .put("X-Auth-Token", authToken).build())
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1")
- .update("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- UpdateImageOptions.Builder.name("newname"),
- UpdateImageOptions.Builder.isPublic(true));
- }
-
- public void testUpdateImageWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromStringWithContentType("somenewdata", MediaType.APPLICATION_OCTET_STREAM))
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").upload("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- new StringPayload("somenewdata")), new ParseImageDetailsTest().expected());
- }
-
- public void testUpdateNameAndImageWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "anothernewname")
- .put("X-Auth-Token", authToken).build())
- .payload(payloadFromStringWithContentType("somenewdata", MediaType.APPLICATION_OCTET_STREAM))
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").upload("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- new StringPayload("somenewdata"), UpdateImageOptions.Builder.name("anothernewname")), new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testUpdateNameAndImageWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "anothernewname")
- .put("X-Auth-Token", authToken).build())
- .payload(payloadFromStringWithContentType("somenewdata", MediaType.APPLICATION_OCTET_STREAM))
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(403).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").upload("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- new StringPayload("somenewdata"), UpdateImageOptions.Builder.name("anothernewname"));
- }
-
- public void testDeleteWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("DELETE")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(200).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertTrue(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").delete("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-
- public void testDeleteWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("DELETE")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertFalse(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").delete("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java
deleted file mode 100644
index 6199fa3..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java
+++ /dev/null
@@ -1,143 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.features;
-
-
-import static org.jclouds.openstack.glance.v1_0.options.CreateImageOptions.Builder.containerFormat;
-import static org.jclouds.openstack.glance.v1_0.options.CreateImageOptions.Builder.diskFormat;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.jclouds.io.payloads.StringPayload;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.openstack.glance.v1_0.internal.BaseGlanceApiLiveTest;
-import org.jclouds.openstack.glance.v1_0.options.ListImageOptions;
-import org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.Iterables;
-
-/**
- * @author Adrian Cole
- * @author Adam Lowe
- */
-@Test(groups = "live", testName = "ImageApiLiveTest")
-public class ImageApiLiveTest extends BaseGlanceApiLiveTest {
-
- @Test
- public void testList() throws Exception {
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- Set<? extends Image> response = imageApi.list().concat().toSet();
- assert null != response;
- for (Image image : response) {
- checkImage(image);
- }
- }
- }
-
- private void checkImage(Image image) {
- assert image.getId() != null : image;
- assert image.getName() != null : image;
- assert image.getLinks() != null : image;
- }
-
- @Test
- public void testListInDetail() throws Exception {
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- Set<? extends ImageDetails> response = imageApi.listInDetail().concat().toSet();
- assert null != response;
- for (ImageDetails image : response) {
- checkImage(image);
- ImageDetails newDetails = imageApi.get(image.getId());
- checkImageDetails(newDetails);
- checkImageDetailsEqual(image, newDetails);
- }
- }
- }
-
- private void checkImageDetails(ImageDetails image) {
- checkImage(image);
- assertTrue(image.getMinDisk() >= 0);
- assertTrue(image.getMinRam() >= 0);
- }
-
- private void checkImageDetailsEqual(ImageDetails image, ImageDetails newDetails) {
- assertEquals(newDetails.getId(), image.getId());
- assertEquals(newDetails.getName(), image.getName());
- assertEquals(newDetails.getLinks(), image.getLinks());
- }
-
- @Test
- public void testCreateUpdateAndDeleteImage() {
- StringPayload imageData = new StringPayload("This isn't really an image!");
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- ImageDetails details = imageApi.create("jclouds-live-test", imageData, diskFormat(DiskFormat.RAW), containerFormat(ContainerFormat.BARE));
- assertEquals(details.getName(), "jclouds-live-test");
- assertEquals(details.getSize().get().longValue(), imageData.getRawContent().length());
-
- details = imageApi.update(details.getId(), UpdateImageOptions.Builder.name("jclouds-live-test2"), UpdateImageOptions.Builder.minDisk(10));
- assertEquals(details.getName(), "jclouds-live-test2");
- assertEquals(details.getMinDisk(), 10);
-
- Image fromListing = imageApi.list(
- ListImageOptions.Builder.containerFormat(ContainerFormat.BARE).name("jclouds-live-test2").limit(2))
- .get(0);
- assertEquals(fromListing.getId(), details.getId());
- assertEquals(fromListing.getSize(), details.getSize());
-
- assertEquals(Iterables.getOnlyElement(imageApi.listInDetail(ListImageOptions.Builder.name("jclouds-live-test2"))), details);
-
- assertTrue(imageApi.delete(details.getId()));
-
- assertTrue(imageApi.list(ListImageOptions.Builder.name("jclouds-live-test2")).isEmpty());
- }
- }
-
- @Test
- public void testReserveUploadAndDeleteImage() {
- StringPayload imageData = new StringPayload("This isn't an image!");
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- ImageDetails details = imageApi.reserve("jclouds-live-res-test", diskFormat(DiskFormat.RAW), containerFormat(ContainerFormat.BARE));
- assertEquals(details.getName(), "jclouds-live-res-test");
-
- details = imageApi.upload(details.getId(), imageData, UpdateImageOptions.Builder.name("jclouds-live-res-test2"), UpdateImageOptions.Builder.minDisk(10));
- assertEquals(details.getName(), "jclouds-live-res-test2");
- assertEquals(details.getSize().get().longValue(), imageData.getRawContent().length());
- assertEquals(details.getMinDisk(), 10);
-
- Image fromListing = Iterables.getOnlyElement(imageApi.list(ListImageOptions.Builder.name("jclouds-live-res-test2").limit(2).containerFormat(ContainerFormat.BARE)));
- assertEquals(fromListing.getId(), details.getId());
- assertEquals(fromListing.getSize(), details.getSize());
-
- assertEquals(Iterables.getOnlyElement(imageApi.listInDetail(ListImageOptions.Builder.name("jclouds-live-res-test2"))), details);
-
- assertTrue(imageApi.delete(details.getId()));
-
- assertTrue(imageApi.list(ListImageOptions.Builder.name("jclouds-live-res-test2")).isEmpty());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java
deleted file mode 100644
index 131517c..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java
+++ /dev/null
@@ -1,83 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMultimap;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseImageDetailsFromHeadersTest")
-public class ParseImageDetailsFromHeadersTest {
-
- ParseImageDetailsFromHeaders fn = new ParseImageDetailsFromHeaders(new SimpleDateFormatDateService());
-
- public HttpResponse response = HttpResponse.builder()
- .message("HTTP/1.1 200 OK")
- .statusCode(200)
- .headers(ImmutableMultimap.<String,String>builder()
- .put("X-Image-Meta-Id", "fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .put("X-Image-Meta-Deleted", "False")
- .put("X-Image-Meta-Container_format", "bare")
- .put("X-Image-Meta-Checksum", "233afa7b8809d840679b5f0d36d7350a")
- .put("X-Image-Meta-Protected", "False")
- .put("X-Image-Meta-Min_disk", "0")
- .put("X-Image-Meta-Created_at", "2012-05-18T18:06:44")
- .put("X-Image-Meta-Size", "65645798")
- .put("X-Image-Meta-Status", "active")
- .put("X-Image-Meta-Is_public", "True")
- .put("X-Image-Meta-Min_ram", "0")
- .put("X-Image-Meta-Owner", "5821675")
- .put("X-Image-Meta-Updated_at", "2012-05-18T18:42:58")
- .put("X-Image-Meta-Disk_format", "raw")
- .put("X-Image-Meta-Name", "debian")
- .put("Location", "http://HOST/v1/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .put("Etag", "233afa7b8809d840679b5f0d36d7350a")
- .build())
- .build();
-
- public void test() {
- assertEquals(fn.apply(response).toString(), expected().toString());
- }
-
- public ImageDetails expected() {
- return ImageDetails.builder()
- .id("fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .status(Image.Status.ACTIVE)
- .owner("5821675")
- .isPublic(true)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:06:44"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:42:58"))
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java
deleted file mode 100644
index 1245788..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java
+++ /dev/null
@@ -1,86 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.handlers;
-
-import static org.easymock.EasyMock.createMockBuilder;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.IArgumentMatcher;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "GlanceErrorHandlerTest")
-public class GlanceErrorHandlerTest {
-
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String content,
- Class<? extends Exception> expected) {
- assertCodeMakes(method, uri, statusCode, message, "text/plain", content, expected);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
- String content, Class<? extends Exception> expected) {
-
- GlanceErrorHandler function = new GlanceErrorHandler();
-
- HttpCommand command = createMockBuilder(HttpCommand.class).createMock();
- HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
- HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
- response.getPayload().getContentMetadata().setContentType(contentType);
-
- expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
- command.setException(classEq(expected));
-
- replay(command);
-
- function.handleError(command, response);
-
- verify(command);
- }
-
- public static Exception classEq(final Class<? extends Exception> in) {
- reportMatcher(new IArgumentMatcher() {
-
- @Override
- public void appendTo(StringBuffer buffer) {
- buffer.append("classEq(");
- buffer.append(in);
- buffer.append(")");
- }
-
- @Override
- public boolean matches(Object arg) {
- return arg.getClass() == in;
- }
-
- });
- return null;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java
deleted file mode 100644
index 36c2229..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java
+++ /dev/null
@@ -1,28 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.internal;
-
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-
-/**
- * Base class for writing KeyStone Rest Api Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseGlanceApiExpectTest extends BaseGlanceExpectTest<GlanceApi> {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java
deleted file mode 100644
index c3b898e..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java
+++ /dev/null
@@ -1,44 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.internal;
-
-import java.util.Properties;
-
-import org.jclouds.apis.BaseApiLiveTest;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
-import org.testng.annotations.Test;
-
-/**
- * Tests behavior of {@code GlanceApi}
- *
- * @author Adrian Cole
- */
-@Test(groups = "live")
-public class BaseGlanceApiLiveTest extends BaseApiLiveTest<GlanceApi> {
-
- public BaseGlanceApiLiveTest() {
- provider = "openstack-glance";
- }
-
- @Override
- protected Properties setupProperties() {
- Properties props = super.setupProperties();
- setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
- return props;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java
deleted file mode 100644
index 40dc393..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java
+++ /dev/null
@@ -1,50 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.internal;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-/**
- * Base class for writing Glance Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseGlanceExpectTest<T> extends BaseRestApiExpectTest<T> {
- protected HttpRequest keystoneAuthWithUsernameAndPassword;
- protected HttpRequest keystoneAuthWithAccessKeyAndSecretKey;
- protected String authToken;
- protected HttpResponse responseWithKeystoneAccess;
- protected HttpRequest extensionsOfGlanceRequest;
- protected HttpResponse extensionsOfGlanceResponse;
- protected HttpResponse unmatchedExtensionsOfGlanceResponse;
-
- public BaseGlanceExpectTest() {
- provider = "openstack-glance";
- keystoneAuthWithUsernameAndPassword = KeystoneFixture.INSTANCE.initialAuthWithUsernameAndPasswordAndTenantName(identity,
- credential);
- keystoneAuthWithAccessKeyAndSecretKey = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantName(identity,
- credential);
-
- authToken = KeystoneFixture.INSTANCE.getAuthToken();
- responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess();
- // now, createContext arg will need tenant prefix
- identity = KeystoneFixture.INSTANCE.getTenantName() + ":" + identity;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java
deleted file mode 100644
index db0e398..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java
+++ /dev/null
@@ -1,63 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParseImageDetailTest")
-public class ParseImageDetailsTest extends BaseItemParserTest<ImageDetails> {
-
- @Override
- public String resource() {
- return "/image.json";
- }
-
- @Override
- @SelectJson("image")
- @Consumes(MediaType.APPLICATION_JSON)
- public ImageDetails expected() {
- return ImageDetails
- .builder()
- .id("02fa0378-f305-43cf-8058-8572fe1da795")
- .name("jclouds-live-test")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("6ae4e0fdc3c108a1bfe10ef5e436f4f4")
- .size(27L)
- .status(Image.Status.ACTIVE)
- .owner("68a7c7abb7bf45ada1536dfa28ec2115")
- .isPublic(false)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-31T10:13:47"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-31T10:13:47"))
- .build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java
deleted file mode 100644
index cf311c1..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java
+++ /dev/null
@@ -1,83 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.parse;
-
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.json.BaseSetParserTest;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseImageDetailsListTest")
-public class ParseImagesInDetailTest extends BaseSetParserTest<ImageDetails> {
-
- @Override
- public String resource() {
- return "/images_detail.json";
- }
-
- @Override
- @SelectJson("images")
- @Consumes(MediaType.APPLICATION_JSON)
- public Set<ImageDetails> expected() {
- return ImmutableSet.<ImageDetails>builder()
- .add(ImageDetails
- .builder()
- .id("fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .status(Image.Status.ACTIVE)
- .owner("5821675")
- .isPublic(true)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:06:44"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:06:45"))
- .build())
- .add(ImageDetails
- .builder()
- .id("f9fcb127-071d-4670-883e-eedb7efac183")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .status(Image.Status.ACTIVE)
- .owner("5821675")
- .isPublic(true)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-11T15:04:47"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-11T15:04:48"))
- .build())
- .build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java
deleted file mode 100644
index aef16e1..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java
+++ /dev/null
@@ -1,79 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.parse;
-
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseSetParserTest;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseImageListTest")
-public class ParseImagesTest extends BaseSetParserTest<Image> {
-
- @Override
- public String resource() {
- return "/images.json";
- }
-
- @Override
- @SelectJson("images")
- @Consumes(MediaType.APPLICATION_JSON)
- public Set<Image> expected() {
- return ImmutableSet.<Image>builder()
- .add(Image
- .builder()
- .id("f0209a30-25b8-4d9a-8e2f-dbc028e20b2b")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .build())
- .add(Image
- .builder()
- .id("fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .build())
- .add(Image
- .builder()
- .id("f9fcb127-071d-4670-883e-eedb7efac183")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .build())
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/image.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/image.json b/openstack/openstack-glance/src/test/resources/image.json
deleted file mode 100644
index 0e47c78..0000000
--- a/openstack/openstack-glance/src/test/resources/image.json
+++ /dev/null
@@ -1 +0,0 @@
-{"image": {"status": "active", "name": "jclouds-live-test", "deleted": false, "container_format": "bare", "created_at": "2012-05-31T10:13:47", "disk_format": "raw", "updated_at": "2012-05-31T10:13:47", "properties": {}, "min_disk": 0, "protected": false, "id": "02fa0378-f305-43cf-8058-8572fe1da795", "checksum": "6ae4e0fdc3c108a1bfe10ef5e436f4f4", "owner": "68a7c7abb7bf45ada1536dfa28ec2115", "is_public": false, "deleted_at": null, "min_ram": 0, "size": 27}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/images.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/images.json b/openstack/openstack-glance/src/test/resources/images.json
deleted file mode 100644
index 29dfb07..0000000
--- a/openstack/openstack-glance/src/test/resources/images.json
+++ /dev/null
@@ -1,24 +0,0 @@
- {
- "images": [{
- "name": "debian",
- "container_format": "bare",
- "disk_format": "raw",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "id": "f0209a30-25b8-4d9a-8e2f-dbc028e20b2b",
- "size": 65645798
- }, {
- "name": "debian",
- "container_format": "bare",
- "disk_format": "raw",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "id": "fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- "size": 65645798
- }, {
- "name": "debian",
- "container_format": "bare",
- "disk_format": "raw",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "id": "f9fcb127-071d-4670-883e-eedb7efac183",
- "size": 65645798
- }]
- }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/images_detail.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/images_detail.json b/openstack/openstack-glance/src/test/resources/images_detail.json
deleted file mode 100644
index 9840138..0000000
--- a/openstack/openstack-glance/src/test/resources/images_detail.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "images": [{
- "status": "active",
- "name": "debian",
- "deleted": false,
- "container_format": "bare",
- "created_at": "2012-05-18T18:06:44",
- "disk_format": "raw",
- "updated_at": "2012-05-18T18:06:45",
- "properties": {},
- "min_disk": 0,
- "protected": false,
- "id": "fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "owner": "5821675",
- "is_public": true,
- "deleted_at": null,
- "min_ram": 0,
- "size": 65645798
- }, {
- "status": "active",
- "name": "debian",
- "deleted": false,
- "container_format": "bare",
- "created_at": "2012-05-11T15:04:47",
- "disk_format": "raw",
- "updated_at": "2012-05-11T15:04:48",
- "properties": {},
- "min_disk": 0,
- "protected": false,
- "id": "f9fcb127-071d-4670-883e-eedb7efac183",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "owner": "5821675",
- "is_public": true,
- "deleted_at": null,
- "min_ram": 0,
- "size": 65645798
- }]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/logback.xml b/openstack/openstack-glance/src/test/resources/logback.xml
deleted file mode 100644
index a4f81d3..0000000
--- a/openstack/openstack-glance/src/test/resources/logback.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<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>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/pom.xml b/openstack/openstack-quantum/pom.xml
deleted file mode 100644
index 9aff8e4..0000000
--- a/openstack/openstack-quantum/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs-openstack</artifactId>
- <version>1.6.2-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.api -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>openstack-quantum</artifactId>
- <name>jclouds openstack-quantum api</name>
- <description>jclouds components to access an implementation of OpenStack Quantum</description>
- <packaging>bundle</packaging>
-
- <properties>
- <!-- keystone endpoint -->
- <test.openstack-quantum.endpoint>http://localhost:5000/v2.0/</test.openstack-quantum.endpoint>
- <!-- keystone version -->
- <test.openstack-quantum.api-version>1.0</test.openstack-quantum.api-version>
- <test.openstack-quantum.build-version />
- <test.openstack-quantum.identity>FIXME_IDENTITY</test.openstack-quantum.identity>
- <test.openstack-quantum.credential>FIXME_CREDENTIALS</test.openstack-quantum.credential>
- <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
- <jclouds.osgi.export>org.jclouds.openstack.quantum.v1_0*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${jclouds.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>
- <systemPropertyVariables>
- <test.openstack-quantum.endpoint>${test.openstack-quantum.endpoint}</test.openstack-quantum.endpoint>
- <test.openstack-quantum.api-version>${test.openstack-quantum.api-version}</test.openstack-quantum.api-version>
- <test.openstack-quantum.build-version>${test.openstack-quantum.build-version}</test.openstack-quantum.build-version>
- <test.openstack-quantum.identity>${test.openstack-quantum.identity}</test.openstack-quantum.identity>
- <test.openstack-quantum.credential>${test.openstack-quantum.credential}</test.openstack-quantum.credential>
- <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
[6/6] git commit: Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
Posted by an...@apache.org.
Removing OpenStack modules from Labs repo (now in jclouds-labs-openstack)
1.6.x version of https://github.com/jclouds/jclouds-labs/pull/18
Project: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/commit/0736d2dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/tree/0736d2dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/diff/0736d2dd
Branch: refs/heads/remove-openstack-1.6.x
Commit: 0736d2dd7fba6002c6900774d387e68ceed01036
Parents: 3300d3a
Author: Andrew Phillips <de...@yahoo.co.uk>
Authored: Fri Aug 2 17:29:22 2013 -0400
Committer: Andrew Phillips <de...@yahoo.co.uk>
Committed: Fri Aug 2 17:29:22 2013 -0400
----------------------------------------------------------------------
openstack/openstack-glance/pom.xml | 124 ------
.../openstack/glance/v1_0/GlanceApi.java | 61 ---
.../glance/v1_0/GlanceApiMetadata.java | 93 ----
.../glance/v1_0/config/GlanceHttpApiModule.java | 91 ----
.../glance/v1_0/config/GlanceProperties.java | 26 --
.../glance/v1_0/domain/ContainerFormat.java | 81 ----
.../glance/v1_0/domain/DiskFormat.java | 93 ----
.../openstack/glance/v1_0/domain/Image.java | 183 --------
.../glance/v1_0/domain/ImageDetails.java | 283 -------------
.../openstack/glance/v1_0/domain/StoreType.java | 55 ---
.../glance/v1_0/features/ImageApi.java | 201 ---------
.../functions/ParseImageDetailsFromHeaders.java | 86 ----
.../functions/internal/ParseImageDetails.java | 95 -----
.../v1_0/functions/internal/ParseImages.java | 95 -----
.../v1_0/handlers/GlanceErrorHandler.java | 63 ---
.../glance/v1_0/options/CreateImageOptions.java | 136 ------
.../glance/v1_0/options/ImageField.java | 36 --
.../glance/v1_0/options/ListImageOptions.java | 268 ------------
.../glance/v1_0/options/UpdateImageOptions.java | 253 -----------
.../services/org.jclouds.apis.ApiMetadata | 1 -
.../glance/v1_0/GlanceApiMetadataTest.java | 35 --
.../v1_0/features/ImageApiExpectTest.java | 420 -------------------
.../glance/v1_0/features/ImageApiLiveTest.java | 143 -------
.../ParseImageDetailsFromHeadersTest.java | 83 ----
.../v1_0/handlers/GlanceErrorHandlerTest.java | 86 ----
.../v1_0/internal/BaseGlanceApiExpectTest.java | 28 --
.../v1_0/internal/BaseGlanceApiLiveTest.java | 44 --
.../v1_0/internal/BaseGlanceExpectTest.java | 50 ---
.../v1_0/parse/ParseImageDetailsTest.java | 63 ---
.../v1_0/parse/ParseImagesInDetailTest.java | 83 ----
.../glance/v1_0/parse/ParseImagesTest.java | 79 ----
.../src/test/resources/image.json | 1 -
.../src/test/resources/images.json | 24 --
.../src/test/resources/images_detail.json | 39 --
.../src/test/resources/logback.xml | 51 ---
openstack/openstack-quantum/pom.xml | 123 ------
.../openstack/quantum/v1_0/QuantumApi.java | 72 ----
.../quantum/v1_0/QuantumApiMetadata.java | 91 ----
.../v1_0/config/QuantumHttpApiModule.java | 85 ----
.../quantum/v1_0/config/QuantumProperties.java | 26 --
.../quantum/v1_0/domain/Attachment.java | 63 ---
.../openstack/quantum/v1_0/domain/Network.java | 102 -----
.../quantum/v1_0/domain/NetworkDetails.java | 108 -----
.../openstack/quantum/v1_0/domain/Port.java | 108 -----
.../quantum/v1_0/domain/PortDetails.java | 103 -----
.../quantum/v1_0/domain/Reference.java | 108 -----
.../quantum/v1_0/features/NetworkApi.java | 122 ------
.../quantum/v1_0/features/PortApi.java | 147 -------
.../v1_0/handlers/QuantumErrorHandler.java | 63 ---
.../services/org.jclouds.apis.ApiMetadata | 1 -
.../quantum/v1_0/QuantumApiMetadataTest.java | 35 --
.../v1_0/features/NetworkApiExpectTest.java | 235 -----------
.../v1_0/features/NetworkApiLiveTest.java | 91 ----
.../v1_0/features/PortApiExpectTest.java | 245 -----------
.../quantum/v1_0/features/PortApiLiveTest.java | 137 ------
.../v1_0/internal/BaseQuantumApiExpectTest.java | 28 --
.../v1_0/internal/BaseQuantumApiLiveTest.java | 44 --
.../v1_0/internal/BaseQuantumExpectTest.java | 57 ---
.../quantum/v1_0/parse/ParseAttachmentTest.java | 45 --
.../v1_0/parse/ParseNetworkDetailsTest.java | 49 ---
.../quantum/v1_0/parse/ParseNetworkTest.java | 45 --
.../v1_0/parse/ParsePortDetailsTest.java | 47 ---
.../quantum/v1_0/parse/ParsePortTest.java | 45 --
.../src/test/resources/attachment.json | 1 -
.../src/test/resources/list_network_refs.json | 14 -
.../src/test/resources/list_networks.json | 14 -
.../src/test/resources/logback.xml | 51 ---
.../src/test/resources/network.json | 1 -
.../src/test/resources/network_details.json | 1 -
.../src/test/resources/port.json | 1 -
.../src/test/resources/port_details.json | 1 -
openstack/openstack-reddwarf/pom.xml | 124 ------
.../openstack/reddwarf/v1/RedDwarfApi.java | 59 ---
.../reddwarf/v1/RedDwarfApiMetadata.java | 96 -----
.../v1/config/RedDwarfHttpApiModule.java | 82 ----
.../v1/config/RedDwarfParserModule.java | 32 --
.../openstack/reddwarf/v1/domain/Flavor.java | 167 --------
.../reddwarf/v1/features/FlavorApi.java | 90 ----
.../v1/handlers/RedDwarfErrorHandler.java | 69 ---
.../services/org.jclouds.apis.ApiMetadata | 1 -
.../reddwarf/v1/domain/FlavorTest.java | 55 ---
.../v1/features/FlavorApiExpectTest.java | 111 -----
.../reddwarf/v1/features/FlavorApiLiveTest.java | 87 ----
.../v1/internal/BaseRedDwarfApiExpectTest.java | 27 --
.../v1/internal/BaseRedDwarfApiLiveTest.java | 43 --
.../v1/internal/BaseRedDwarfExpectTest.java | 71 ----
.../reddwarf/v1/parse/ParseFlavorListTest.java | 108 -----
.../src/test/resources/access_rax_us.json | 163 -------
.../src/test/resources/flavor_get.json | 17 -
.../src/test/resources/flavor_list.json | 94 -----
.../src/test/resources/logback.xml | 51 ---
openstack/openstack-swift/pom.xml | 135 ------
.../jclouds/openstack/swift/v1/SwiftApi.java | 74 ----
.../openstack/swift/v1/SwiftApiMetadata.java | 91 ----
.../swift/v1/config/SwiftHttpApiModule.java | 87 ----
.../swift/v1/config/SwiftProperties.java | 26 --
.../openstack/swift/v1/domain/Account.java | 120 ------
.../openstack/swift/v1/domain/Container.java | 157 -------
.../openstack/swift/v1/features/AccountApi.java | 49 ---
.../swift/v1/features/ContainerApi.java | 70 ----
.../openstack/swift/v1/features/ObjectApi.java | 40 --
...ParseAccountMetadataResponseFromHeaders.java | 40 --
.../swift/v1/handlers/SwiftErrorHandler.java | 80 ----
.../swift/v1/options/ListContainersOptions.java | 77 ----
.../services/org.jclouds.apis.ApiMetadata | 1 -
.../v1/PasswordAuthenticationExpectTest.java | 70 ----
.../swift/v1/SwiftApiMetadataTest.java | 36 --
.../swift/v1/SwiftErrorHandlerTest.java | 115 -----
.../swift/v1/features/AccountApiExpectTest.java | 55 ---
.../swift/v1/features/AccountApiLiveTest.java | 44 --
.../v1/features/ContainerApiExpectTest.java | 74 ----
.../swift/v1/features/ContainerApiLiveTest.java | 48 ---
.../swift/v1/features/ObjectApiExpectTest.java | 28 --
.../swift/v1/features/ObjectApiLiveTest.java | 28 --
.../v1/internal/BaseSwiftApiExpectTest.java | 28 --
.../swift/v1/internal/BaseSwiftApiLiveTest.java | 41 --
.../swift/v1/internal/BaseSwiftExpectTest.java | 50 ---
.../v1/options/ListContainersOptionsTest.java | 94 -----
.../swift/v1/parse/ParseContainerListTest.java | 57 ---
.../src/test/resources/container_list.json | 4 -
.../src/test/resources/logback.xml | 51 ---
openstack/pom.xml | 41 --
pom.xml | 1 -
rackspace-clouddns-uk/pom.xml | 144 -------
rackspace-clouddns-us/pom.xml | 165 --------
rackspace-clouddns/pom.xml | 153 -------
126 files changed, 9983 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/pom.xml b/openstack/openstack-glance/pom.xml
deleted file mode 100644
index cdd561a..0000000
--- a/openstack/openstack-glance/pom.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?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.labs</groupId>
- <artifactId>jclouds-labs-openstack</artifactId>
- <version>1.6.2-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.api -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>openstack-glance</artifactId>
- <name>jclouds openstack-glance api</name>
- <description>jclouds components to access an implementation of OpenStack Glance</description>
- <packaging>bundle</packaging>
-
- <properties>
- <!-- keystone endpoint -->
- <test.openstack-glance.endpoint>http://localhost:5000/v2.0/</test.openstack-glance.endpoint>
- <!-- keystone version -->
- <test.openstack-glance.api-version>1.0</test.openstack-glance.api-version>
- <test.openstack-glance.build-version />
- <test.openstack-glance.identity>FIXME_IDENTITY</test.openstack-glance.identity>
- <test.openstack-glance.credential>FIXME_CREDENTIALS</test.openstack-glance.credential>
- <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
-
- <jclouds.osgi.export>org.jclouds.openstack.glance.v1_0*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${jclouds.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>
- <systemPropertyVariables>
- <test.openstack-glance.endpoint>${test.openstack-glance.endpoint}</test.openstack-glance.endpoint>
- <test.openstack-glance.api-version>${test.openstack-glance.api-version}</test.openstack-glance.api-version>
- <test.openstack-glance.build-version>${test.openstack-glance.build-version}</test.openstack-glance.build-version>
- <test.openstack-glance.identity>${test.openstack-glance.identity}</test.openstack-glance.identity>
- <test.openstack-glance.credential>${test.openstack-glance.credential}</test.openstack-glance.credential>
- <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApi.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApi.java
deleted file mode 100644
index 7c16f41..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApi.java
+++ /dev/null
@@ -1,61 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0;
-
-import java.io.Closeable;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Zone;
-import org.jclouds.location.functions.ZoneToEndpoint;
-import org.jclouds.openstack.glance.v1_0.features.ImageApi;
-import org.jclouds.openstack.v2_0.features.ExtensionApi;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-
-import com.google.inject.Provides;
-
-/**
- * Provides access to Glance.
- * <p/>
- *
- * @see <a href="http://glance.openstack.org/glanceapi.html">api doc</a>
- * @author Adrian Cole
- */
-public interface GlanceApi extends Closeable {
- /**
- *
- * @return the Zone codes configured
- */
- @Provides
- @Zone
- Set<String> getConfiguredZones();
-
- /**
- * Provides access to Extension features.
- */
- @Delegate
- ExtensionApi getExtensionApiForZone(
- @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
- /**
- * Provides access to Image features.
- */
- @Delegate
- ImageApi getImageApiForZone(@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadata.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadata.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadata.java
deleted file mode 100644
index 499b502..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadata.java
+++ /dev/null
@@ -1,93 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0;
-
-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.apis.ApiMetadata;
-import org.jclouds.openstack.glance.v1_0.config.GlanceHttpApiModule;
-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.v2_0.ServiceType;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for Glance 1.0 API
- *
- * @author Adrian Cole
- */
-public class GlanceApiMetadata extends BaseHttpApiMetadata<GlanceApi> {
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public GlanceApiMetadata() {
- this(new Builder());
- }
-
- protected GlanceApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.setProperty(SERVICE_TYPE, ServiceType.IMAGE);
- properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<GlanceApi, Builder> {
-
- protected Builder() {
- id("openstack-glance")
- .name("OpenStack Glance API")
- .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
- .credentialName("${password}")
- .endpointName("KeyStone base url ending in /v2.0/")
- .documentation(URI.create("http://glance.openstack.org/glanceapi.html"))
- .version("1.0")
- .defaultEndpoint("http://localhost:5000/v2.0/")
- .defaultProperties(GlanceApiMetadata.defaultProperties())
- .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
- .add(AuthenticationApiModule.class)
- .add(KeystoneAuthenticationModule.class)
- .add(ZoneModule.class)
- .add(GlanceHttpApiModule.class).build());
- }
-
- @Override
- public GlanceApiMetadata build() {
- return new GlanceApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceHttpApiModule.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceHttpApiModule.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceHttpApiModule.java
deleted file mode 100644
index b1f4e2b..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceHttpApiModule.java
+++ /dev/null
@@ -1,91 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.config;
-
-
-import java.net.URI;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Provider;
-import javax.inject.Singleton;
-
-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.json.config.GsonModule.DateAdapter;
-import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.glance.v1_0.handlers.GlanceErrorHandler;
-import org.jclouds.openstack.v2_0.domain.Extension;
-import org.jclouds.openstack.v2_0.functions.PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.config.HttpApiModule;
-import org.jclouds.rest.functions.ImplicitOptionalConverter;
-
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.Multimap;
-import com.google.inject.Provides;
-
-/**
- * Configures the Glance connection.
- *
- * @author Adrian Cole
- */
-@ConfiguresHttpApi
-public class GlanceHttpApiModule extends HttpApiModule<GlanceApi> {
-
- public GlanceHttpApiModule() {
- }
-
- @Override
- protected void configure() {
- bind(DateAdapter.class).to(Iso8601DateAdapter.class);
- bind(ImplicitOptionalConverter.class).to(PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.class);
- super.configure();
- }
-
- @Provides
- @Singleton
- public Multimap<URI, URI> aliases() {
- return ImmutableMultimap.<URI, URI>builder()
- .build();
- }
-
- @Provides
- @Singleton
- public LoadingCache<String, Set<? extends Extension>> provideExtensionsByZone(final Provider<GlanceApi> glanceApi) {
- return CacheBuilder.newBuilder().expireAfterWrite(23, TimeUnit.HOURS)
- .build(new CacheLoader<String, Set<? extends Extension>>() {
- @Override
- public Set<? extends Extension> load(String key) throws Exception {
- return glanceApi.get().getExtensionApiForZone(key).list();
- }
- });
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(GlanceErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(GlanceErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(GlanceErrorHandler.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceProperties.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceProperties.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceProperties.java
deleted file mode 100644
index 65fa044..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/config/GlanceProperties.java
+++ /dev/null
@@ -1,26 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.config;
-
-/**
- * Configuration properties and constants used in openstack Glance connections.
- *
- * @author Adrian Cole
- */
-public class GlanceProperties {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ContainerFormat.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ContainerFormat.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ContainerFormat.java
deleted file mode 100644
index bb112cf..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ContainerFormat.java
+++ /dev/null
@@ -1,81 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * The container format refers to whether the virtual machine image is in a file format that also
- * contains metadata about the actual virtual machine.
- *
- * <h3>Note</h3>
- *
- * Note that the container format string is not currently used by Glance or other OpenStack
- * components, so it is safe to simply specify {@link #BARE} as the container format if you are
- * unsure.
- *
- * @author Adrian Cole
- * @see <a href= "http://glance.openstack.org/formats.html" />
- */
-public enum ContainerFormat {
- /**
- * This indicates there is no container or metadata envelope for the image
- */
- BARE,
-
- /**
- * This is the OVF container format
- */
- OVF,
-
- /**
- * This indicates what is stored in Glance is an Amazon kernel image
- */
- AKI,
-
- /**
- * This indicates what is stored in Glance is an Amazon ramdisk image
- */
- ARI,
-
- /**
- * This indicates what is stored in Glance is an Amazon machine image
- */
- AMI,
-
- /**
- * Type unknown to jclouds
- */
- UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static ContainerFormat fromValue(String containerFormat) {
- try {
- return valueOf(checkNotNull(containerFormat, "containerFormat").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/DiskFormat.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/DiskFormat.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/DiskFormat.java
deleted file mode 100644
index 1dd0ca8..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/DiskFormat.java
+++ /dev/null
@@ -1,93 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * The disk format of a virtual machine image is the format of the underlying disk image. Virtual
- * appliance vendors have different formats for laying out the information contained in a virtual
- * machine disk image.
- *
- * @author Adrian Cole
- * @see <a href= "http://glance.openstack.org/formats.html" />
- */
-public enum DiskFormat {
- /**
- * This is an unstructured disk image format
- */
- RAW,
- /**
- * This is the VHD disk format, a common disk format used by virtual machine monitors from
- * VMWare, Xen, Microsoft, VirtualBox, and others
- */
- VHD,
- /**
- * Another common disk format supported by many common virtual machine monitors
- */
- VMDK,
- /**
- * A disk format supported by VirtualBox virtual machine monitor and the QEMU emulator
- */
- VDI,
- /**
- * An archive format for the data contents of an optical disc (e.g. CDROM).
- */
- ISO,
- /**
- * A disk format supported by the QEMU emulator that can expand dynamically and supports Copy on
- * Write
- */
- QCOW2,
-
- /**
- * This indicates what is stored in Glance is an Amazon kernel image
- */
- AKI,
-
- /**
- * This indicates what is stored in Glance is an Amazon ramdisk image
- */
- ARI,
-
- /**
- * This indicates what is stored in Glance is an Amazon machine image
- */
- AMI,
-
- /**
- * Type unknown to jclouds
- */
- UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static DiskFormat fromValue(String diskFormat) {
- try {
- return valueOf(checkNotNull(diskFormat, "diskFormat").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/Image.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/Image.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/Image.java
deleted file mode 100644
index 5ec2a6a..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/Image.java
+++ /dev/null
@@ -1,183 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.domain;
-
-import java.beans.ConstructorProperties;
-import java.util.Set;
-
-import javax.inject.Named;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.v2_0.domain.Link;
-import org.jclouds.openstack.v2_0.domain.Resource;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.base.Optional;
-
-/**
- * An image the Glance server knows about
- *
- * @author Adrian Cole
- * @see <a href= "http://glance.openstack.org/glanceapi.html" />
- * @see <a href= "https://github.com/openstack/glance/blob/master/glance/api/v1/images.py" />
- */
-public class Image extends Resource {
-
- /**
- */
- public static enum Status {
-
- UNRECOGNIZED, ACTIVE, SAVING, QUEUED, KILLED, PENDING_DELETE, DELETED;
-
- public String value() {
- return name();
- }
-
- public static Status fromValue(String v) {
- try {
- return valueOf(v.toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
- }
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromImage(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Resource.Builder<T> {
- protected ContainerFormat containerFormat;
- protected DiskFormat diskFormat;
- protected Long size;
- protected String checksum;
-
- /**
- * @see Image#getContainerFormat()
- */
- public T containerFormat(ContainerFormat containerFormat) {
- this.containerFormat = containerFormat;
- return self();
- }
-
- /**
- * @see Image#getDiskFormat()
- */
- public T diskFormat(DiskFormat diskFormat) {
- this.diskFormat = diskFormat;
- return self();
- }
-
- /**
- * @see Image#getSize()
- */
- public T size(Long size) {
- this.size = size;
- return self();
- }
-
- /**
- * @see Image#getChecksum()
- */
- public T checksum(String checksum) {
- this.checksum = checksum;
- return self();
- }
-
- public Image build() {
- return new Image(id, name, links, containerFormat, diskFormat, size, checksum);
- }
-
- public T fromImage(Image in) {
- return super.fromResource(in)
- .containerFormat(in.getContainerFormat().orNull())
- .diskFormat(in.getDiskFormat().orNull())
- .size(in.getSize().orNull())
- .checksum(in.getChecksum().orNull());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- @Named("container_format")
- private final Optional<ContainerFormat> containerFormat;
- @Named("disk_format")
- private final Optional<DiskFormat> diskFormat;
- private final Optional<Long> size;
- private final Optional<String> checksum;
-
- @ConstructorProperties({
- "id", "name", "links", "container_format", "disk_format", "size", "checksum"
- })
- protected Image(String id, @Nullable String name, Set<Link> links, @Nullable ContainerFormat containerFormat,
- @Nullable DiskFormat diskFormat, @Nullable Long size, @Nullable String checksum) {
- super(id, name, links);
- this.containerFormat = Optional.fromNullable(containerFormat);
- this.diskFormat = Optional.fromNullable(diskFormat);
- this.size = Optional.fromNullable(size);
- this.checksum = Optional.fromNullable(checksum);
- }
-
- public Optional<ContainerFormat> getContainerFormat() {
- return this.containerFormat;
- }
-
- public Optional<DiskFormat> getDiskFormat() {
- return this.diskFormat;
- }
-
- public Optional<Long> getSize() {
- return this.size;
- }
-
- public Optional<String> getChecksum() {
- return this.checksum;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(super.hashCode(), containerFormat, diskFormat, size, checksum);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- Image that = Image.class.cast(obj);
- return super.equals(that) && Objects.equal(this.containerFormat, that.containerFormat)
- && Objects.equal(this.diskFormat, that.diskFormat)
- && Objects.equal(this.size, that.size)
- && Objects.equal(this.checksum, that.checksum);
- }
-
- protected ToStringHelper string() {
- return super.string()
- .add("containerFormat", containerFormat).add("diskFormat", diskFormat).add("size", size).add("checksum", checksum);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ImageDetails.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ImageDetails.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ImageDetails.java
deleted file mode 100644
index ca781cc..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/ImageDetails.java
+++ /dev/null
@@ -1,283 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-import java.util.Date;
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Named;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.v2_0.domain.Link;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableMap;
-
-/**
- * Detailed listing of an Image
- *
- * @author Adrian Cole
- * @see <a href= "http://glance.openstack.org/glanceapi.html" />
- * @see <a href= "https://github.com/openstack/glance/blob/master/glance/api/v1/images.py" />
- * @see <a href= "https://github.com/openstack/glance/blob/master/glance/registry/db/api.py" />
- */
-public class ImageDetails extends Image {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return new ConcreteBuilder().fromImageDetails(this);
- }
-
- public abstract static class Builder<T extends Builder<T>> extends Image.Builder<T> {
- protected long minDisk;
- protected long minRam;
- protected String location;
- protected String owner;
- protected Date updatedAt;
- protected Date createdAt;
- protected Date deletedAt;
- protected Image.Status status;
- protected boolean isPublic;
- protected Map<String, String> properties = ImmutableMap.of();
-
- /**
- * @see ImageDetails#getMinDisk()
- */
- public T minDisk(long minDisk) {
- this.minDisk = minDisk;
- return self();
- }
-
- /**
- * @see ImageDetails#getMinRam()
- */
- public T minRam(long minRam) {
- this.minRam = minRam;
- return self();
- }
-
- /**
- * @see ImageDetails#getLocation()
- */
- public T location(String location) {
- this.location = location;
- return self();
- }
-
- /**
- * @see ImageDetails#getOwner()
- */
- public T owner(String owner) {
- this.owner = owner;
- return self();
- }
-
- /**
- * @see ImageDetails#getUpdatedAt()
- */
- public T updatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;
- return self();
- }
-
- /**
- * @see ImageDetails#getCreatedAt()
- */
- public T createdAt(Date createdAt) {
- this.createdAt = createdAt;
- return self();
- }
-
- /**
- * @see ImageDetails#getDeletedAt()
- */
- public T deletedAt(Date deletedAt) {
- this.deletedAt = deletedAt;
- return self();
- }
-
- /**
- * @see ImageDetails#getStatus()
- */
- public T status(Image.Status status) {
- this.status = status;
- return self();
- }
-
- /**
- * @see ImageDetails#isPublic()
- */
- public T isPublic(boolean isPublic) {
- this.isPublic = isPublic;
- return self();
- }
-
- /**
- * @see ImageDetails#getProperties()
- */
- public T properties(Map<String, String> properties) {
- this.properties = ImmutableMap.copyOf(checkNotNull(properties, "properties"));
- return self();
- }
-
- public ImageDetails build() {
- return new ImageDetails(id, name, links, containerFormat, diskFormat, size, checksum, minDisk, minRam, location, owner, updatedAt, createdAt, deletedAt, status, isPublic, properties);
- }
-
- public T fromImageDetails(ImageDetails in) {
- return super.fromImage(in)
- .minDisk(in.getMinDisk())
- .minRam(in.getMinRam())
- .location(in.getLocation().orNull())
- .owner(in.getOwner().orNull())
- .updatedAt(in.getUpdatedAt())
- .createdAt(in.getCreatedAt())
- .deletedAt(in.getDeletedAt().orNull())
- .status(in.getStatus())
- .isPublic(in.isPublic())
- .properties(in.getProperties());
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- @Override
- protected ConcreteBuilder self() {
- return this;
- }
- }
-
- @Named("min_disk")
- private final long minDisk;
- @Named("min_ram")
- private final long minRam;
- private final Optional<String> location;
- private final Optional<String> owner;
- @Named("updated_at")
- private final Date updatedAt;
- @Named("created_at")
- private final Date createdAt;
- @Named("deleted_at")
- private final Optional<Date> deletedAt;
- private final Image.Status status;
- @Named("is_public")
- private final boolean isPublic;
- private final Map<String, String> properties;
-
- @ConstructorProperties({
- "id", "name", "links", "container_format", "disk_format", "size", "checksum", "min_disk", "min_ram", "location", "owner", "updated_at", "created_at", "deleted_at", "status", "is_public", "properties"
- })
- protected ImageDetails(String id, @Nullable String name, Set<Link> links, @Nullable ContainerFormat containerFormat,
- @Nullable DiskFormat diskFormat, @Nullable Long size, @Nullable String checksum, long minDisk,
- long minRam, @Nullable String location, @Nullable String owner, Date updatedAt,
- Date createdAt, @Nullable Date deletedAt, Image.Status status, boolean isPublic,
- Map<String, String> properties) {
- super(id, name, links, containerFormat, diskFormat, size, checksum);
- this.minDisk = minDisk;
- this.minRam = minRam;
- this.location = Optional.fromNullable(location);
- this.owner = Optional.fromNullable(owner);
- this.updatedAt = checkNotNull(updatedAt, "updatedAt");
- this.createdAt = checkNotNull(createdAt, "createdAt");
- this.deletedAt = Optional.fromNullable(deletedAt);
- this.status = checkNotNull(status, "status");
- this.isPublic = isPublic;
- this.properties = ImmutableMap.copyOf(checkNotNull(properties, "properties"));
- }
-
- /**
- * Note this could be zero if unset
- */
- public long getMinDisk() {
- return this.minDisk;
- }
-
- /**
- * Note this could be zero if unset
- */
- public long getMinRam() {
- return this.minRam;
- }
-
- public Optional<String> getLocation() {
- return this.location;
- }
-
- public Optional<String> getOwner() {
- return this.owner;
- }
-
- public Date getUpdatedAt() {
- return this.updatedAt;
- }
-
- public Date getCreatedAt() {
- return this.createdAt;
- }
-
- public Optional<Date> getDeletedAt() {
- return this.deletedAt;
- }
-
- public Image.Status getStatus() {
- return this.status;
- }
-
- public boolean isPublic() {
- return this.isPublic;
- }
-
- public Map<String, String> getProperties() {
- return this.properties;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(minDisk, minRam, location, owner, updatedAt, createdAt, deletedAt, status, isPublic, properties);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null || getClass() != obj.getClass()) return false;
- ImageDetails that = ImageDetails.class.cast(obj);
- return super.equals(that) && Objects.equal(this.minDisk, that.minDisk)
- && Objects.equal(this.minRam, that.minRam)
- && Objects.equal(this.location, that.location)
- && Objects.equal(this.owner, that.owner)
- && Objects.equal(this.updatedAt, that.updatedAt)
- && Objects.equal(this.createdAt, that.createdAt)
- && Objects.equal(this.deletedAt, that.deletedAt)
- && Objects.equal(this.status, that.status)
- && Objects.equal(this.isPublic, that.isPublic)
- && Objects.equal(this.properties, that.properties);
- }
-
- protected ToStringHelper string() {
- return super.string()
- .add("minDisk", minDisk).add("minRam", minRam).add("location", location).add("owner", owner).add("updatedAt", updatedAt).add("createdAt", createdAt).add("deletedAt", deletedAt).add("status", status).add("isPublic", isPublic).add("properties", properties);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/StoreType.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/StoreType.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/StoreType.java
deleted file mode 100644
index d21b178..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/domain/StoreType.java
+++ /dev/null
@@ -1,55 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.domain;
-
-/**
- * Backing store types for glance images
- *
- * @author Adam Lowe
- * @see <a href= "http://glance.openstack.org/architecture.html#what-is-a-store" />
- */
-public enum StoreType {
- /**
- * Filesystem store
- */
- FILE,
- /**
- * S3 store
- */
- S3,
- /**
- * OpenStack swift store
- */
- SWIFT,
- /**
- * RADOS (Reliable Autonomic Distributed Object Store) Block Device store
- */
- RBD,
- /**
- * HTTP (read-only) store
- */
- HTTP;
-
- public String value() {
- return name().toLowerCase().replace("_", "+");
- }
-
- @Override
- public String toString() {
- return value();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/features/ImageApi.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/features/ImageApi.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/features/ImageApi.java
deleted file mode 100644
index 5747f72..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/features/ImageApi.java
+++ /dev/null
@@ -1,201 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static javax.ws.rs.core.MediaType.APPLICATION_OCTET_STREAM;
-
-import java.io.InputStream;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HEAD;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.io.Payload;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.openstack.glance.v1_0.functions.ParseImageDetailsFromHeaders;
-import org.jclouds.openstack.glance.v1_0.functions.internal.ParseImageDetails;
-import org.jclouds.openstack.glance.v1_0.functions.internal.ParseImages;
-import org.jclouds.openstack.glance.v1_0.options.CreateImageOptions;
-import org.jclouds.openstack.glance.v1_0.options.ListImageOptions;
-import org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions;
-import org.jclouds.openstack.keystone.v2_0.KeystoneFallbacks.EmptyPaginatedCollectionOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.domain.PaginatedCollection;
-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.ResponseParser;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Transform;
-
-/**
- * Image Services
- *
- * @author Adrian Cole
- * @author Adam Lowe
- * @see <a href="http://glance.openstack.org/glanceapi.html">api doc</a>
- * @see <a
- * href="https://github.com/openstack/glance/blob/master/glance/api/v1/images.py">api
- * src</a>
- */
-@RequestFilters(AuthenticateRequest.class)
-public interface ImageApi {
-
- /**
- * List all images (IDs, names, links)
- *
- * @return all images (IDs, names, links)
- */
- @GET
- @Consumes(APPLICATION_JSON)
- @Path("/images")
- @RequestFilters(AuthenticateRequest.class)
- @ResponseParser(ParseImages.class)
- @Transform(ParseImages.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<? extends Image> list();
-
- @GET
- @Consumes(APPLICATION_JSON)
- @Path("/images")
- @RequestFilters(AuthenticateRequest.class)
- @ResponseParser(ParseImages.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<? extends Image> list(ListImageOptions options);
-
- /**
- * List all images (all details)
- *
- * @return all images (all details)
- */
- @GET
- @Consumes(APPLICATION_JSON)
- @Path("/images/detail")
- @RequestFilters(AuthenticateRequest.class)
- @ResponseParser(ParseImageDetails.class)
- @Transform(ParseImageDetails.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<? extends ImageDetails> listInDetail();
-
- @GET
- @Consumes(APPLICATION_JSON)
- @Path("/images/detail")
- @RequestFilters(AuthenticateRequest.class)
- @ResponseParser(ParseImageDetails.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<? extends ImageDetails> listInDetail(ListImageOptions options);
-
- /**
- * Return metadata about an image with id
- */
- @HEAD
- @Path("/images/{id}")
- @ResponseParser(ParseImageDetailsFromHeaders.class)
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- ImageDetails get(@PathParam("id") String id);
-
- /**
- * Return image data for image with id
- */
- @GET
- @Path("/images/{id}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- InputStream getAsStream(@PathParam("id") String id);
-
- /**
- * Create a new image
- *
- * @return detailed metadata about the newly stored image
- */
- @POST
- @Path("/images")
- @Produces(APPLICATION_OCTET_STREAM)
- @SelectJson("image")
- @Consumes(APPLICATION_JSON)
- ImageDetails create(@HeaderParam("x-image-meta-name") String name, Payload payload, CreateImageOptions... options);
-
- /**
- * Reserve a new image to be uploaded later
- *
- * @return detailed metadata about the newly stored image
- * @see #upload
- */
- @POST
- @Path("/images")
- @SelectJson("image")
- @Consumes(APPLICATION_JSON)
- ImageDetails reserve(@HeaderParam("x-image-meta-name") String name, CreateImageOptions... options);
-
- /**
- * Upload image data for a previously-reserved image
- * <p/>
- * If an image was previously reserved, and thus is in the queued state, then
- * image data can be added using this method. If the image already as data
- * associated with it (e.g. not in the queued state), then you will receive a
- * 409 Conflict exception.
- *
- * @param imageData
- * the new image to upload
- * @param options
- * can be used to adjust the metadata stored for the image in the
- * same call
- * @return detailed metadata about the updated image
- * @see #reserve
- */
- @PUT
- @Path("/images/{id}")
- @Produces(APPLICATION_OCTET_STREAM)
- @SelectJson("image")
- @Consumes(APPLICATION_JSON)
- ImageDetails upload(@PathParam("id") String id, Payload imageData, UpdateImageOptions... options);
-
- /**
- * Adjust the metadata stored for an existing image
- *
- * @return detailed metadata about the updated image
- */
- @PUT
- @Path("/images/{id}")
- @SelectJson("image")
- @Consumes(APPLICATION_JSON)
- ImageDetails update(@PathParam("id") String id, UpdateImageOptions... options);
-
- /**
- * Delete the image with the specified id
- *
- * @return true if successful
- */
- @DELETE
- @Path("/images/{id}")
- @Fallback(FalseOnNotFoundOr404.class)
- boolean delete(@PathParam("id") String id);
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeaders.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeaders.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeaders.java
deleted file mode 100644
index a85175e..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeaders.java
+++ /dev/null
@@ -1,86 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.functions;
-
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CHECKSUM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CONTAINER_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CREATED_AT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.DELETED_AT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.DISK_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.ID;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.IS_PUBLIC;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.LOCATION;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_DISK;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_RAM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.NAME;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.OWNER;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.STATUS;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.UPDATED_AT;
-
-import javax.inject.Inject;
-
-import org.jclouds.date.DateService;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image.Status;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-
-import com.google.common.base.Function;
-
-/**
- * This parses {@link ImageDetails} from HTTP headers.
- *
- * @author Adrian Cole
- */
-public class ParseImageDetailsFromHeaders implements Function<HttpResponse, ImageDetails> {
- private final DateService dateService;
-
- @Inject
- public ParseImageDetailsFromHeaders(DateService dateService) {
- this.dateService = dateService;
- }
-
- @Override
- public ImageDetails apply(HttpResponse from) {
- ImageDetails.Builder<?> builder = ImageDetails.builder()
- .id(from.getFirstHeaderOrNull(ID.asHeader()))
- .name(from.getFirstHeaderOrNull(NAME.asHeader()))
- .checksum(from.getFirstHeaderOrNull(CHECKSUM.asHeader()))
- .minDisk(Long.parseLong(from.getFirstHeaderOrNull(MIN_DISK.asHeader())))
- .minRam(Long.parseLong(from.getFirstHeaderOrNull(MIN_RAM.asHeader())))
- .isPublic(Boolean.parseBoolean(from.getFirstHeaderOrNull(IS_PUBLIC.asHeader())))
- .createdAt(dateService.iso8601SecondsDateParse(from.getFirstHeaderOrNull(CREATED_AT.asHeader())))
- .updatedAt(dateService.iso8601SecondsDateParse(from.getFirstHeaderOrNull(UPDATED_AT.asHeader())))
- .owner(from.getFirstHeaderOrNull(OWNER.asHeader()))
- .location(from.getFirstHeaderOrNull(LOCATION.asHeader()))
- .status(Status.fromValue(from.getFirstHeaderOrNull(STATUS.asHeader())));
-
- String containerFormat = from.getFirstHeaderOrNull(CONTAINER_FORMAT.asHeader());
- String diskFormat = from.getFirstHeaderOrNull(DISK_FORMAT.asHeader());
- String deletedAt = from.getFirstHeaderOrNull(DELETED_AT.asHeader());
- String size = from.getFirstHeaderOrNull(SIZE.asHeader());
-
- if (containerFormat != null) builder.containerFormat(ContainerFormat.fromValue(containerFormat));
- if (diskFormat != null) builder.diskFormat(DiskFormat.fromValue(diskFormat));
- if (deletedAt != null) builder.deletedAt(dateService.iso8601SecondsDateParse(deletedAt));
- if (size != null) builder.size(Long.parseLong(size));
-
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImageDetails.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImageDetails.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImageDetails.java
deleted file mode 100644
index 8e049fe..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImageDetails.java
+++ /dev/null
@@ -1,95 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.openstack.glance.v1_0.options.ListImageOptions.Builder.marker;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.collect.IterableWithMarker;
-import org.jclouds.collect.internal.Arg0ToPagedIterable;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.openstack.glance.v1_0.features.ImageApi;
-import org.jclouds.openstack.glance.v1_0.functions.internal.ParseImageDetails.Images;
-import org.jclouds.openstack.keystone.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.v2_0.domain.Link;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.inject.TypeLiteral;
-
-/**
- * boiler plate until we determine a better way
- *
- * @author Adrian Cole
- */
-@Beta
-@Singleton
-public class ParseImageDetails extends ParseJson<Images> {
- static class Images extends PaginatedCollection<ImageDetails> {
-
- @ConstructorProperties({ "images", "images_links" })
- protected Images(Iterable<ImageDetails> images, Iterable<Link> images_links) {
- super(images, images_links);
- }
-
- }
-
- @Inject
- public ParseImageDetails(Json json) {
- super(json, TypeLiteral.get(Images.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<ImageDetails, ToPagedIterable> {
-
- private final GlanceApi api;
-
- @Inject
- protected ToPagedIterable(GlanceApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<ImageDetails>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.isPresent() ? arg0.get().toString() : null;
- final ImageApi imageApi = api.getImageApiForZone(zone);
- return new Function<Object, IterableWithMarker<ImageDetails>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<ImageDetails> apply(Object input) {
- return IterableWithMarker.class.cast(imageApi.listInDetail(marker(input.toString())));
- }
-
- @Override
- public String toString() {
- return "listInDetail()";
- }
- };
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImages.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImages.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImages.java
deleted file mode 100644
index 671be38..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/functions/internal/ParseImages.java
+++ /dev/null
@@ -1,95 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.openstack.glance.v1_0.options.ListImageOptions.Builder.marker;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.collect.IterableWithMarker;
-import org.jclouds.collect.internal.Arg0ToPagedIterable;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.features.ImageApi;
-import org.jclouds.openstack.glance.v1_0.functions.internal.ParseImages.Images;
-import org.jclouds.openstack.keystone.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.v2_0.domain.Link;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.inject.TypeLiteral;
-
-/**
- * boiler plate until we determine a better way
- *
- * @author Adrian Cole
- */
-@Beta
-@Singleton
-public class ParseImages extends ParseJson<Images> {
- static class Images extends PaginatedCollection<Image> {
-
- @ConstructorProperties({ "images", "images_links" })
- protected Images(Iterable<Image> images, Iterable<Link> images_links) {
- super(images, images_links);
- }
-
- }
-
- @Inject
- public ParseImages(Json json) {
- super(json, TypeLiteral.get(Images.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<Image, ToPagedIterable> {
-
- private final GlanceApi api;
-
- @Inject
- protected ToPagedIterable(GlanceApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Image>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.isPresent() ? arg0.get().toString() : null;
- final ImageApi imageApi = api.getImageApiForZone(zone);
- return new Function<Object, IterableWithMarker<Image>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Image> apply(Object input) {
- return IterableWithMarker.class.cast(imageApi.list(marker(input.toString())));
- }
-
- @Override
- public String toString() {
- return "list()";
- }
- };
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandler.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandler.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandler.java
deleted file mode 100644
index aaff9bf..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandler.java
+++ /dev/null
@@ -1,63 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.handlers;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-
-import javax.inject.Singleton;
-
-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 org.jclouds.rest.ResourceNotFoundException;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- *
- * @author Adrian Cole
- *
- */
-// TODO: is there error spec someplace? let's type errors, etc.
-@Singleton
-public class GlanceErrorHandler 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);
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 400:
- break;
- case 401:
- case 403:
- exception = new AuthorizationException(message, exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- exception = new ResourceNotFoundException(message, exception);
- }
- break;
- }
- command.setException(exception);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/CreateImageOptions.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/CreateImageOptions.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/CreateImageOptions.java
deleted file mode 100644
index 9ad42b1..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/CreateImageOptions.java
+++ /dev/null
@@ -1,136 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.options;
-
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.StoreType;
-
-/**
- *
- * <h2></h2>Usage</h2> The recommended way to instantiate a CreateImageOptions object is to statically import
- * CreateImageOptions.Builder.* and invoke a static creation method for each option as needed:
- * <p/>
- * <code>
- * import static org.jclouds.openstack.glance.v1_0.options.CreateImageOptions.Builder.*
- *
- *
- * // this will create an image with the name "imageName", minimum required disk of 10GB, etc.
- * details = api.create("imageName", minDisk(10), isPublic(true), property("mykey", "somevalue"));
- * <code>
-
- * @author Adam Lowe
- * @see <a href="http://glance.openstack.org/glanceapi.html"/>
- */
-public class CreateImageOptions extends UpdateImageOptions {
-
- /**
- * When present, Glance will use the supplied identifier for the image instead of generating one. If the identifier
- * already exists in that Glance node, then a 409 Conflict will be returned by Glance. The value of the header must
- * be a uuid in hexadecimal string notation (i.e. 71c675ab-d94f-49cd-a114-e12490b328d9).
- */
- public CreateImageOptions id(String id) {
- headers.put(ImageField.ID.asHeader(), id);
- return this;
- }
-
- public static class Builder {
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#id
- */
- public static CreateImageOptions id(String id) {
- return new CreateImageOptions().id(id);
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#storeType
- */
- public static CreateImageOptions storeType(StoreType storeType) {
- return CreateImageOptions.class.cast(new CreateImageOptions().storeType(storeType));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#diskFormat
- */
- public static CreateImageOptions diskFormat(DiskFormat diskFormat) {
- return CreateImageOptions.class.cast(new CreateImageOptions().diskFormat(diskFormat));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#containerFormat
- */
- public static CreateImageOptions containerFormat(ContainerFormat containerFormat) {
- return CreateImageOptions.class.cast(new CreateImageOptions().containerFormat(containerFormat));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#size
- */
- public static CreateImageOptions size(long size) {
- return CreateImageOptions.class.cast(new CreateImageOptions().size(size));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#checksum
- */
- public static CreateImageOptions checksum(String checksum) {
- return CreateImageOptions.class.cast(new CreateImageOptions().checksum(checksum));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#isPublic
- */
- public static CreateImageOptions isPublic(boolean isPublic) {
- return CreateImageOptions.class.cast(new CreateImageOptions().isPublic(isPublic));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#isProtected
- */
- public static CreateImageOptions isProtected(boolean isProtected) {
- return CreateImageOptions.class.cast(new CreateImageOptions().isProtected(isProtected));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#minRam
- */
- public static CreateImageOptions minRam(long ram) {
- return CreateImageOptions.class.cast(new CreateImageOptions().minRam(ram));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#minDisk
- */
- public static CreateImageOptions minDisk(long disk) {
- return CreateImageOptions.class.cast(new CreateImageOptions().minDisk(disk));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#owner
- */
- public static CreateImageOptions owner(String owner) {
- return CreateImageOptions.class.cast(new CreateImageOptions().owner(owner));
- }
-
- /**
- * @see org.jclouds.openstack.glance.v1_0.options.CreateImageOptions#property
- */
- public static CreateImageOptions property(String key, String value) {
- return CreateImageOptions.class.cast(new CreateImageOptions().property(key, value));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ImageField.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ImageField.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ImageField.java
deleted file mode 100644
index b4978d9..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ImageField.java
+++ /dev/null
@@ -1,36 +0,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.
- */
-package org.jclouds.openstack.glance.v1_0.options;
-
-
-/**
- * Fields used in Glance options
- */
-public enum ImageField {
- ID, NAME, CHECKSUM, MIN_DISK, MIN_RAM, IS_PUBLIC, PROTECTED, CREATED_AT, UPDATED_AT, DELETED_AT,
- OWNER, LOCATION, STATUS, DISK_FORMAT, CONTAINER_FORMAT, SIZE, SIZE_MIN, SIZE_MAX, STORE, PROPERTY;
-
- public static final String HEADER_PREFIX = "X-Image-Meta-";
-
- public String asParam() {
- return name().toLowerCase();
- }
-
- public String asHeader() {
- return HEADER_PREFIX + name().charAt(0) + name().substring(1).toLowerCase();
- }
-}