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:27 UTC
[6/6] git commit: Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
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();
- }
-}