You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2014/12/23 05:26:29 UTC
[05/51] [partial] stratos git commit: dropping jclouds 1.8.0 clone
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
deleted file mode 100644
index c280fa9..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
+++ /dev/null
@@ -1,132 +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.nova.v2_0.extensions;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.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.FalseOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.VolumeAttachment;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.openstack.v2_0.services.Extension;
-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.annotations.Beta;
-import com.google.common.collect.FluentIterable;
-
-/**
- * Provides access to the OpenStack Compute (Nova) Volume Attachments Extension API.
- *
- * This API strictly handles attaching Volumes to Servers. To create and manage Volumes you need to use one of the
- * following APIs:
- *
- * 1. The Cinder API
- * If your OpenStack deployment is Folsom or later and it supports the Cinder block storage service, use this API.
- * @see org.jclouds.openstack.cinder.v1.features.VolumeApi
- *
- * 2. The nova-volume API
- * If your OpenStack deployment is Essex or earlier and it supports the nova-volume extension, use this API.
- * @see org.jclouds.openstack.nova.v2_0.extensions.VolumeApi
- *
- */
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VOLUMES)
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/servers")
-public interface VolumeAttachmentApi {
- /**
- * List Volume Attachments for a given Server.
- *
- * @param serverId The ID of the Server
- * @return All VolumeAttachments for the Server
- */
- @Named("volumeAttachment:list")
- @GET
- @Path("/{serverId}/os-volume_attachments")
- @SelectJson("volumeAttachments")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<VolumeAttachment> listAttachmentsOnServer(@PathParam("serverId") String serverId);
-
- /**
- * Get a specific Volume Attachment for a Volume and Server.
- *
- * @param volumeId The ID of the Volume
- * @param serverId The ID of the Server
- * @return The Volume Attachment.
- */
- @Named("volumeAttachment:get")
- @GET
- @Path("/{serverId}/os-volume_attachments/{id}")
- @SelectJson("volumeAttachment")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- VolumeAttachment getAttachmentForVolumeOnServer(@PathParam("id") String volumeId,
- @PathParam("serverId") String serverId);
-
- /**
- * Attach a Volume to a Server.
- *
- * Note: If you are using KVM as your hypervisor then the actual device name in the Server will be different than
- * the one specified. When the Server sees a new device, it picks the next available name (which in most cases is
- * /dev/vdc) and the disk shows up there on the Server.
- *
- * @param serverId The ID of the Server
- * @param volumeId The ID of the Volume
- * @param device The name of the device this Volume will be identified as in the Server (e.g. /dev/vdc)
- * @return The Volume Attachment.
- */
- @Named("volumeAttachment:attach")
- @POST
- @Path("/{serverId}/os-volume_attachments")
- @SelectJson("volumeAttachment")
- @Produces(MediaType.APPLICATION_JSON)
- @WrapWith("volumeAttachment")
- VolumeAttachment attachVolumeToServerAsDevice(@PayloadParam("volumeId") String volumeId,
- @PathParam("serverId") String serverId, @PayloadParam("device") String device);
-
- /**
- * Detach a Volume from a server.
- *
- * Note: Make sure you've unmounted the volume first. Failure to do so could result in failure or data loss.
- *
- * @param volumeId The ID of the Volume
- * @param serverId The ID of the Server
- * @return true if successful
- */
- @Named("volumeAttachment:detach")
- @DELETE
- @Path("/{serverId}/os-volume_attachments/{id}")
- @Fallback(FalseOnNotFoundOr404.class)
- boolean detachVolumeFromServer(@PathParam("id") String volumeId,
- @PathParam("serverId") String serverId);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApi.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApi.java
deleted file mode 100644
index 943fe4b..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApi.java
+++ /dev/null
@@ -1,180 +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.nova.v2_0.extensions;
-
-import java.util.Map;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404;
-import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.VolumeType;
-import org.jclouds.openstack.nova.v2_0.options.CreateVolumeTypeOptions;
-import org.jclouds.openstack.v2_0.ServiceType;
-import org.jclouds.openstack.v2_0.services.Extension;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.Payload;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Unwrap;
-import org.jclouds.rest.annotations.WrapWith;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.annotations.Beta;
-import com.google.common.collect.FluentIterable;
-
-/**
- * Provides access to the OpenStack Compute (Nova) Volume Type extension API.
- *
- * @see VolumeApi
- */
-@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VOLUME_TYPES)
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/os-volume-types")
-public interface VolumeTypeApi {
- /**
- * @return set of all volume types
- */
- @Named("volumeType:list")
- @GET
- @SelectJson("volume_types")
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<VolumeType> list();
-
- /**
- * Gets a volume type
- *
- * @param id the id of the volume type to retrieve
- * @return the requested volume type
- */
- @Named("volumeType:get")
- @GET
- @Path("/{id}")
- @SelectJson("volume_type")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- VolumeType get(@PathParam("id") String id);
-
- /**
- * Creates a new volume type
- *
- * @param name the name of the new volume type
- * @param options optional settings for the new volume type
- * @return the new volume type
- */
- @Named("volumeType:create")
- @POST
- @SelectJson("volume_type")
- @Produces(MediaType.APPLICATION_JSON)
- @WrapWith("volume_type")
- VolumeType create(@PayloadParam("name") String name, CreateVolumeTypeOptions... options);
-
- /**
- * Deletes a volume type
- *
- * @param id the id of the volume type to delete
- */
- @Named("volumeType:delete")
- @DELETE
- @Path("/{id}")
- @Fallback(FalseOnNotFoundOr404.class)
- boolean delete(@PathParam("id") String id);
-
- /**
- * Gets the extra specs for a volume type
- *
- * @param id the id of the volume type
- * @return the set of extra metadata for the flavor
- */
- @Named("volumeType:getExtraSpecs")
- @GET
- @Path("/{id}/extra_specs")
- @SelectJson("extra_specs")
- @Fallback(EmptyMapOnNotFoundOr404.class)
- Map<String, String> getExtraSpecs(@PathParam("id") String id);
-
- /**
- * Creates or updates the extra metadata for a given flavor
- */
- @Named("volumeType:updateExtraSpecs")
- @POST
- @Path("/{id}/extra_specs")
- @Produces(MediaType.APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- @Fallback(FalseOnNotFoundOr404.class)
- boolean updateExtraSpecs(@PathParam("id") String id, @PayloadParam("extra_specs") Map<String, String> specs);
-
- /**
- * Retrieve a single extra spec value
- *
- * @param id the id of the volume type
- * @param key the key of the extra spec item to retrieve
- */
- @Named("volumeType:getExtraSpec")
- @GET
- @Path("/{id}/extra_specs/{key}")
- @Unwrap
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- String getExtraSpec(@PathParam("id") String id, @PathParam("key") String key);
-
- /**
- * Creates or updates a single extra spec value
- *
- * @param id the id of the volume type
- * @param key the extra spec key (when creating ensure this does not include whitespace or other difficult characters)
- * @param value the new value to store associate with the key
- */
- @Named("volumeType:updateExtraSpec")
- @PUT
- @Path("/{id}/extra_specs/{key}")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("%7B\"{key}\":\"{value}\"%7D")
- @Fallback(FalseOnNotFoundOr404.class)
- boolean updateExtraSpec(@PathParam("id") String id,
- @PathParam("key") @PayloadParam("key") String key,
- @PayloadParam("value") String value);
-
- /**
- * Deletes an existing extra spec
- *
- * @param id the id of the volume type
- * @param key the key of the extra spec to delete
- */
- @Named("volumeType:deleteExtraSpec")
- @DELETE
- @Path("/{id}/extra_specs/{key}")
- @Fallback(FalseOnNotFoundOr404.class)
- boolean deleteExtraSpec(@PathParam("id") String id, @PathParam("key") String key);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java
deleted file mode 100644
index 6d151a6..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.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.nova.v2_0.features;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.keystone.v2_0.KeystoneFallbacks.EmptyPaginatedCollectionOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.Flavor;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseFlavorDetails;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseFlavors;
-import org.jclouds.openstack.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.v2_0.domain.Resource;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-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;
-import org.jclouds.rest.annotations.Unwrap;
-import org.jclouds.rest.annotations.WrapWith;
-
-/**
- * Provides access to the OpenStack Compute (Nova) Flavor API.
- * <p/>
- *
- */
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/flavors")
-public interface FlavorApi {
- /**
- * List all flavors (IDs, names, links)
- *
- * @return all flavors (IDs, names, links)
- */
- @Named("flavor:list")
- @GET
- @ResponseParser(ParseFlavors.class)
- @Transform(ParseFlavors.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<Resource> list();
-
- @Named("flavor:list")
- @GET
- @ResponseParser(ParseFlavors.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<Resource> list(PaginationOptions options);
-
- /**
- * List all flavors (all details)
- *
- * @return all flavors (all details)
- */
- @Named("flavor:list")
- @GET
- @Path("/detail")
- @ResponseParser(ParseFlavorDetails.class)
- @Transform(ParseFlavorDetails.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<Flavor> listInDetail();
-
- @Named("flavor:list")
- @GET
- @Path("/detail")
- @ResponseParser(ParseFlavorDetails.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<Flavor> listInDetail(PaginationOptions options);
-
- /**
- * List details of the specified flavor
- *
- * @param id
- * id of the flavor
- * @return flavor or null if not found
- */
- @Named("flavor:get")
- @GET
- @Path("/{id}")
- @SelectJson("flavor")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Flavor get(@PathParam("id") String id);
-
- /**
- * Create flavor according to the provided object
- *
- * @param flavor - flavor object
- * @return newly created flavor
- */
- @Named("flavor:create")
- @POST
- @Unwrap
- @Produces(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Flavor create(@WrapWith("flavor") Flavor flavor);
-
- /**
- * Delete flavor with a given id
- *
- * @param id - flavor id
- */
- @Named("flavor:delete")
- @DELETE
- @Path("/{id}")
- @Fallback(VoidOnNotFoundOr404.class)
- void delete(@PathParam("id") String id);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java
deleted file mode 100644
index 025af01..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java
+++ /dev/null
@@ -1,231 +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.nova.v2_0.features;
-
-import java.util.Map;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404;
-import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.keystone.v2_0.KeystoneFallbacks.EmptyPaginatedCollectionOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.binders.BindMetadataToJsonPayload;
-import org.jclouds.openstack.nova.v2_0.domain.Image;
-import org.jclouds.openstack.nova.v2_0.functions.internal.OnlyMetadataValueOrNull;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseImageDetails;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseImages;
-import org.jclouds.openstack.v2_0.domain.Resource;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-/**
- * Provides access to the OpenStack Compute (Nova) Image API.
- */
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/images")
-public interface ImageApi {
- /**
- * List all images (IDs, names, links)
- *
- * @return all images (IDs, names, links)
- */
- @Named("image:list")
- @GET
- @ResponseParser(ParseImages.class)
- @Transform(ParseImages.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<Resource> list();
-
- @Named("image:list")
- @GET
- @ResponseParser(ParseImages.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<Resource> list(PaginationOptions options);
-
- /**
- * List all images (all details)
- *
- * @return all images (all details)
- */
- @Named("image:list")
- @GET
- @Path("/detail")
- @ResponseParser(ParseImageDetails.class)
- @Transform(ParseImageDetails.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<Image> listInDetail();
-
- @Named("image:list")
- @GET
- @Path("/detail")
- @ResponseParser(ParseImageDetails.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<Image> listInDetail(PaginationOptions options);
-
- /**
- * List details of the specified image
- *
- * @param id
- * id of the server
- * @return server or null if not found
- */
- @Named("image:get")
- @GET
- @Path("/{id}")
- @SelectJson("image")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Image get(@PathParam("id") String id);
-
- /**
- * Delete the specified image
- *
- * @param id
- * id of the image
- * @return server or null if not found
- */
- @Named("image:delete")
- @DELETE
- @Path("/{id}")
- @Fallback(VoidOnNotFoundOr404.class)
- void delete(@PathParam("id") String id);
-
- /**
- * List all metadata for an image.
- *
- * @param id
- * id of the image
- * @return the metadata as a Map<String, String>
- */
- @Named("image:getMetadata")
- @GET
- @Path("/{id}/metadata")
- @SelectJson("metadata")
- @Fallback(EmptyMapOnNotFoundOr404.class)
- Map<String, String> getMetadata(@PathParam("id") String id);
-
- /**
- * Sets the metadata for an image.
- *
- * @param id
- * id of the image
- * @param metadata
- * a Map containing the metadata
- * @return the metadata as a Map<String, String>
- */
- @Named("image:setMetadata")
- @PUT
- @Path("/{id}/metadata")
- @SelectJson("metadata")
- @Produces(MediaType.APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- @Fallback(EmptyMapOnNotFoundOr404.class)
- Map<String, String> setMetadata(@PathParam("id") String id, @PayloadParam("metadata") Map<String, String> metadata);
-
- /**
- * Update the metadata for a server.
- *
- * @param id
- * id of the image
- * @param metadata
- * a Map containing the metadata
- * @return the metadata as a Map<String, String>
- */
- @Named("image:updateMetadata")
- @POST
- @Path("/{id}/metadata")
- @SelectJson("metadata")
- @Produces(MediaType.APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- @Fallback(EmptyMapOnNotFoundOr404.class)
- Map<String, String> updateMetadata(@PathParam("id") String id, @PayloadParam("metadata") Map<String, String> metadata);
-
- /**
- * Update the metadata for an image.
- *
- * @param id
- * id of the image
- * @param metadata
- * a Map containing the metadata
- * @return the value or null if not present
- */
- @Named("image:getMetadata")
- @GET
- @Path("/{id}/metadata/{key}")
- @ResponseParser(OnlyMetadataValueOrNull.class)
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- String getMetadata(@PathParam("id") String id, @PathParam("key") String key);
-
- /**
- * Set a metadata item for an image.
- *
- * @param id
- * id of the image
- * @param key
- * the name of the metadata item
- * @param value
- * the value of the metadata item
- * @return the value you updated
- */
- @Named("image:updateMetadata")
- @PUT
- @Path("/{id}/metadata/{key}")
- @ResponseParser(OnlyMetadataValueOrNull.class)
- @MapBinder(BindMetadataToJsonPayload.class)
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- String updateMetadata(@PathParam("id") String id, @PathParam("key") @PayloadParam("key") String key,
- @PathParam("value") @PayloadParam("value") String value);
-
- /**
- * Delete a metadata item from an image.
- *
- * @param id
- * id of the image
- * @param key
- * the name of the metadata item
- */
- @Named("image:deleteMetadata")
- @DELETE
- @Path("/{id}/metadata/{key}")
- @Fallback(VoidOnNotFoundOr404.class)
- void deleteMetadata(@PathParam("id") String id, @PathParam("key") String key);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java
deleted file mode 100644
index 80f1d9e..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java
+++ /dev/null
@@ -1,433 +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.nova.v2_0.features;
-
-import com.google.common.base.Optional;
-
-import java.util.Map;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.AbsentOn403Or404Or500;
-import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404;
-import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404;
-import org.jclouds.Fallbacks.FalseOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.openstack.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.keystone.v2_0.KeystoneFallbacks.EmptyPaginatedCollectionOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.binders.BindMetadataToJsonPayload;
-import org.jclouds.openstack.nova.v2_0.domain.RebootType;
-import org.jclouds.openstack.nova.v2_0.domain.Server;
-import org.jclouds.openstack.nova.v2_0.domain.ServerCreated;
-import org.jclouds.openstack.nova.v2_0.functions.ParseImageIdFromLocationHeader;
-import org.jclouds.openstack.nova.v2_0.functions.internal.OnlyMetadataValueOrNull;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseDiagnostics;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseServerDetails;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseServers;
-import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
-import org.jclouds.openstack.nova.v2_0.options.RebuildServerOptions;
-import org.jclouds.openstack.v2_0.domain.Resource;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.Payload;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.annotations.Unwrap;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-/**
- * Provides access to the OpenStack Compute (Nova) Server API.
- */
-@RequestFilters(AuthenticateRequest.class)
-@Consumes(MediaType.APPLICATION_JSON)
-@Path("/servers")
-public interface ServerApi {
- /**
- * List all servers (IDs, names, links)
- *
- * @return all servers (IDs, names, links)
- */
- @Named("server:list")
- @GET
- @ResponseParser(ParseServers.class)
- @Transform(ParseServers.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<Resource> list();
-
- @Named("server:list")
- @GET
- @ResponseParser(ParseServers.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<Resource> list(PaginationOptions options);
-
- /**
- * List all servers (all details)
- *
- * @return all servers (all details)
- */
- @Named("server:list")
- @GET
- @Path("/detail")
- @ResponseParser(ParseServerDetails.class)
- @Transform(ParseServerDetails.ToPagedIterable.class)
- @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
- PagedIterable<Server> listInDetail();
-
- @Named("server:list")
- @GET
- @Path("/detail")
- @ResponseParser(ParseServerDetails.class)
- @Fallback(EmptyPaginatedCollectionOnNotFoundOr404.class)
- PaginatedCollection<Server> listInDetail(PaginationOptions options);
-
- /**
- * List details of the specified server
- *
- * @param id
- * id of the server
- * @return server or null if not found
- */
- @Named("server:get")
- @GET
- @Path("/{id}")
- @SelectJson("server")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Server get(@PathParam("id") String id);
-
- /**
- * Create a new server
- *
- * @param name
- * name of the server to create
- * @param imageRef
- * reference to the image for the server to use
- * @param flavorRef
- * reference to the flavor to use when creating the server
- * @param options
- * optional parameters to be passed into the server creation
- * request
- * @return the newly created server
- */
- @Named("server:create")
- @POST
- @Unwrap
- @MapBinder(CreateServerOptions.class)
- ServerCreated create(@PayloadParam("name") String name, @PayloadParam("imageRef") String imageRef,
- @PayloadParam("flavorRef") String flavorRef, CreateServerOptions... options);
-
- /**
- * Terminate and delete a server.
- *
- * @param id
- * id of the server
- * @return True if successful, False otherwise
- */
- @Named("server:delete")
- @DELETE
- @Path("/{id}")
- @Fallback(FalseOnNotFoundOr404.class)
- boolean delete(@PathParam("id") String id);
-
- /**
- * Start a server
- *
- * @param id
- * id of the server
- */
- @Named("server:start")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("{\"os-start\":null}")
- void start(@PathParam("id") String id);
-
- /**
- * Stop a server
- *
- * @param id
- * id of the server
- */
- @Named("server:stop")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("{\"os-stop\":null}")
- void stop(@PathParam("id") String id);
-
- /**
- * Reboot a server.
- *
- * @param id
- * id of the server
- * @param rebootType
- * The type of reboot to perform (Hard/Soft)
- */
- @Named("server:reboot")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("%7B\"reboot\":%7B\"type\":\"{type}\"%7D%7D")
- void reboot(@PathParam("id") String id, @PayloadParam("type") RebootType rebootType);
-
- /**
- * Resize a server to a new flavor size.
- *
- * @param id
- * id of the server
- * @param flavorId
- * id of the new flavor to use
- */
- @Named("server:resize")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("%7B\"resize\":%7B\"flavorRef\":{flavorId}%7D%7D")
- void resize(@PathParam("id") String id, @PayloadParam("flavorId") String flavorId);
-
- /**
- * Confirm a resize operation.
- *
- * @param id
- * id of the server
- */
- @Named("server:confirmResize")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("{\"confirmResize\":null}")
- void confirmResize(@PathParam("id") String id);
-
- /**
- * Revert a resize operation.
- *
- * @param id
- * id of the server
- */
- @Named("server:revertResize")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("{\"revertResize\":null}")
- void revertResize(@PathParam("id") String id);
-
- /**
- * Rebuild a server.
- *
- * @param id
- * id of the server
- * @param options
- * Optional parameters to the rebuilding operation.
- */
- @Named("server:rebuild")
- @POST
- @Path("/{id}/action")
- @MapBinder(RebuildServerOptions.class)
- void rebuild(@PathParam("id") String id, RebuildServerOptions... options);
-
- /**
- * Change the administrative password to a server.
- *
- * @param id
- * id of the server
- * @param adminPass
- * The new administrative password to use
- */
- @Named("server:changeAdminPass")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("%7B\"changePassword\":%7B\"adminPass\":\"{adminPass}\"%7D%7D")
- void changeAdminPass(@PathParam("id") String id, @PayloadParam("adminPass") String adminPass);
-
- /**
- * Rename a server.
- *
- * @param id
- * id of the server
- * @param newName
- * The new name for the server
- */
- @Named("server:rename")
- @PUT
- @Path("/{id}")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("%7B\"server\":%7B\"name\":\"{name}\"%7D%7D")
- void rename(@PathParam("id") String id, @PayloadParam("name") String newName);
-
- /**
- * Create an image from a server.
- *
- * @param name
- * The name of the new image
- * @param id
- * id of the server
- *
- * @return ID of the new / updated image
- */
- @Named("server:createImageFromServer")
- @POST
- @Path("/{id}/action")
- @Produces(MediaType.APPLICATION_JSON)
- @Payload("%7B\"createImage\":%7B\"name\":\"{name}\", \"metadata\": %7B%7D%7D%7D")
- @ResponseParser(ParseImageIdFromLocationHeader.class)
- @Fallback(MapHttp4xxCodesToExceptions.class)
- String createImageFromServer(@PayloadParam("name") String name, @PathParam("id") String id);
-
- /**
- * List all metadata for a server.
- *
- * @param id
- * id of the server
- *
- * @return the metadata as a Map<String, String>
- */
- @Named("server:getMetadata")
- @GET
- @Path("/{id}/metadata")
- @SelectJson("metadata")
- @Fallback(EmptyMapOnNotFoundOr404.class)
- Map<String, String> getMetadata(@PathParam("id") String id);
-
- /**
- * Set the metadata for a server.
- *
- * @param id
- * id of the server
- * @param metadata
- * a Map containing the metadata
- * @return the metadata as a Map<String, String>
- */
- @Named("server:setMetadata")
- @PUT
- @Path("/{id}/metadata")
- @SelectJson("metadata")
- @Produces(MediaType.APPLICATION_JSON)
- @Fallback(EmptyMapOnNotFoundOr404.class)
- @MapBinder(BindToJsonPayload.class)
- Map<String, String> setMetadata(@PathParam("id") String id,
- @PayloadParam("metadata") Map<String, String> metadata);
-
- /**
- * Update the metadata for a server.
- *
- * @param id
- * id of the server
- * @param metadata
- * a Map containing the metadata
- * @return the metadata as a Map<String, String>
- */
- @Named("server:updateMetadata")
- @POST
- @Path("/{id}/metadata")
- @Produces(MediaType.APPLICATION_JSON)
- @SelectJson("metadata")
- @MapBinder(BindToJsonPayload.class)
- @Fallback(EmptyMapOnNotFoundOr404.class)
- Map<String, String> updateMetadata(@PathParam("id") String id,
- @PayloadParam("metadata") Map<String, String> metadata);
-
- /**
- * Update the metadata for a server.
- *
- * @param id
- * id of the image
- * @param metadata
- * a Map containing the metadata
- * @return the value or null if not present
- */
- @Named("server:getMetadata")
- @GET
- @Path("/{id}/metadata/{key}")
- @ResponseParser(OnlyMetadataValueOrNull.class)
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- String getMetadata(@PathParam("id") String id, @PathParam("key") String key);
-
- /**
- * Set a metadata item for a server.
- *
- * @param id
- * id of the image
- * @param key
- * the name of the metadata item
- * @param value
- * the value of the metadata item
- * @return the value you updated
- */
- @Named("server:updateMetadata")
- @PUT
- @Path("/{id}/metadata/{key}")
- @Produces(MediaType.APPLICATION_JSON)
- @ResponseParser(OnlyMetadataValueOrNull.class)
- @MapBinder(BindMetadataToJsonPayload.class)
- String updateMetadata(@PathParam("id") String id, @PathParam("key") @PayloadParam("key") String key,
- @PathParam("value") @PayloadParam("value") String value);
-
- /**
- * Delete a metadata item from a server.
- *
- * @param id
- * id of the image
- * @param key
- * the name of the metadata item
- */
- @Named("server:deleteMetadata")
- @DELETE
- @Path("/{id}/metadata/{key}")
- @Fallback(VoidOnNotFoundOr404.class)
- void deleteMetadata(@PathParam("id") String id, @PathParam("key") String key);
-
- /**
- * Get usage information about the server such as CPU usage, Memory and IO.
- * The information returned by this method is dependent on the hypervisor
- * in use by the OpenStack installation and whether that hypervisor supports
- * this method. More information can be found in the
- * <a href="http://api.openstack.org/api-ref.html"> OpenStack API
- * reference</a>. <br/>
- * At the moment the returned response is a generic map. In future versions
- * of OpenStack this might be subject to change.
- *
- * @param id
- * id of the server
- * @return A Map containing the collected values organized by key - value.
- */
- @Named("server:getDiagnostics")
- @GET
- @Path("/{id}/diagnostics")
- @ResponseParser(ParseDiagnostics.class)
- @Fallback(AbsentOn403Or404Or500.class)
- Optional<Map<String, String>> getDiagnostics(@PathParam("id") String id);
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/FieldValueResponseParsers.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/FieldValueResponseParsers.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/FieldValueResponseParsers.java
deleted file mode 100644
index f137c59..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/FieldValueResponseParsers.java
+++ /dev/null
@@ -1,105 +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.nova.v2_0.functions;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseFirstJsonValueNamed;
-import org.jclouds.json.internal.GsonWrapper;
-
-import com.google.common.base.Function;
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.TypeLiteral;
-
-/**
- * Parsers for extracting a single field value from a response and comparing it to an expected value
- */
-public class FieldValueResponseParsers {
- @Singleton
- public static class StatusEnabledResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public StatusEnabledResponseParser(GsonWrapper wrapper) {
- super(wrapper, "status", "enabled");
- }
- }
-
- @Singleton
- public static class StatusDisabledResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public StatusDisabledResponseParser(GsonWrapper wrapper) {
- super(wrapper, "status", "disabled");
- }
- }
-
- @Singleton
- public static class MaintenanceModeEnabledResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public MaintenanceModeEnabledResponseParser(GsonWrapper wrapper) {
- super(wrapper, "maintenance_mode", "on_maintenance");
- }
- }
-
- @Singleton
- public static class MaintenanceModeDisabledResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public MaintenanceModeDisabledResponseParser(GsonWrapper wrapper) {
- super(wrapper, "maintenance_mode", "off_maintenance");
- }
- }
-
- @Singleton
- public static class PowerIsStartupResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public PowerIsStartupResponseParser(GsonWrapper wrapper) {
- super(wrapper, "power_action", "startup");
- }
- }
-
- @Singleton
- public static class PowerIsShutdownResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public PowerIsShutdownResponseParser(GsonWrapper wrapper) {
- super(wrapper, "power_action", "shutdown");
- }
- }
-
- @Singleton
- public static class PowerIsRebootResponseParser extends FieldValueResponseParser<String> {
- @Inject
- public PowerIsRebootResponseParser(GsonWrapper wrapper) {
- super(wrapper, "power_action", "reboot");
- }
- }
-
- public abstract static class FieldValueResponseParser<T> implements Function<HttpResponse, Boolean> {
- private final T expectedValue;
- private final ParseFirstJsonValueNamed<T> valueParser;
-
- public FieldValueResponseParser(GsonWrapper wrapper, String fieldName, T expectedValue) {
- valueParser = new ParseFirstJsonValueNamed<T>(wrapper, new TypeLiteral<T>() {
- }, fieldName);
- this.expectedValue = expectedValue;
- }
-
- @Override
- public Boolean apply(HttpResponse response) {
- return Objects.equal(expectedValue, valueParser.apply(response));
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/OverLimitParser.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/OverLimitParser.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/OverLimitParser.java
deleted file mode 100644
index a52a0d2..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/OverLimitParser.java
+++ /dev/null
@@ -1,89 +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.nova.v2_0.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-
-import org.jclouds.json.Json;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-
-/**
- *
- * The expected body contains the time as in this (real) response
- *
- * <pre>
- * {
- * "overLimit" : {
- * "code" : 413,
- * "message" : "OverLimit Retry...",
- * "details" : "Error Details...",
- * "retryAt" : "2012-11-14T21:51:28UTC"
- * }
- * }
- * </pre>
- *
- * or
- *
- * <pre>
- * {
- * "overLimit": {
- * "message": "This request was rate-limited.",
- * "code": 413,
- * "retryAfter": "54",
- * "details": "Only 1 POST request(s) can be made to \"*\" every minute."
- * }
- * }
- * </pre>
- */
-public class OverLimitParser implements Function<String, Map<String, String>> {
-
- @Resource
- private Logger logger = Logger.NULL;
- private final Json json;
-
- @Inject
- public OverLimitParser(Json json) {
- this.json = checkNotNull(json, "json");
- }
-
- private static class Holder {
- Map<String, String> overLimit = ImmutableMap.of();
- }
-
- /**
- * parses or returns an empty map.
- */
- @Override
- public Map<String, String> apply(String in) {
- try {
- return json.fromJson(in, OverLimitParser.Holder.class).overLimit;
- } catch (RuntimeException e) {
- // an error was raised during parsing -which can include badly
- // formatted fields.
- logger.error("Failed to parse " + in + "", e);
- return ImmutableMap.of();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/ParseImageIdFromLocationHeader.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/ParseImageIdFromLocationHeader.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/ParseImageIdFromLocationHeader.java
deleted file mode 100644
index ec7f005..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/ParseImageIdFromLocationHeader.java
+++ /dev/null
@@ -1,37 +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.nova.v2_0.functions;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpResponse;
-
-import com.google.common.base.Function;
-import com.google.common.net.HttpHeaders;
-
-/**
- * This parses {@link Image} from the body of the link in the Location header of the HTTPResponse.
- */
-@Singleton
-public class ParseImageIdFromLocationHeader implements Function<HttpResponse, String> {
-
- public String apply(HttpResponse response) {
- String location = response.getFirstHeaderOrNull(HttpHeaders.LOCATION);
- String[] parts = location.split("/");
- return parts[parts.length - 1];
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/OnlyMetadataValueOrNull.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/OnlyMetadataValueOrNull.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/OnlyMetadataValueOrNull.java
deleted file mode 100644
index ba9ad1f..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/OnlyMetadataValueOrNull.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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.internal.GsonWrapper;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import com.google.inject.TypeLiteral;
-
-@Singleton
-public class OnlyMetadataValueOrNull implements Function<HttpResponse, String> {
- private final ParseJson<Wrapper> parser;
-
- private static class Wrapper implements Supplier<String> {
- private Map<String, String> metadata;
-
- @Override
- public String get() {
- return metadata == null ? null : Iterables.get(metadata.values(), 0, null);
- }
-
- }
-
- @Inject
- public OnlyMetadataValueOrNull(GsonWrapper gsonView) {
- this.parser = new ParseJson<Wrapper>(checkNotNull(gsonView, "gsonView"), new TypeLiteral<Wrapper>() {
- });
- }
-
- public String apply(HttpResponse response) {
- checkNotNull(response, "response");
- return parser.apply(response).get();
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseDiagnostics.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseDiagnostics.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseDiagnostics.java
deleted file mode 100644
index 85ee041..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseDiagnostics.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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseJson;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.inject.Inject;
-import java.util.Map;
-
-public class ParseDiagnostics implements Function<HttpResponse, Optional <Map<String, String>>> {
-
-
- private final ParseJson<Optional <Map<String, String>>> parser;
-
- @Inject
- public ParseDiagnostics(ParseJson<Optional <Map<String, String>>> parser) {
- this.parser = parser;
- }
-
- @Override
- public Optional <Map<String, String>> apply(HttpResponse response) {
- checkNotNull(response, "response");
- return parser.apply(response);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavorDetails.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavorDetails.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavorDetails.java
deleted file mode 100644
index 260c6c9..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavorDetails.java
+++ /dev/null
@@ -1,92 +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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.common.base.Optional;
-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.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.domain.Flavor;
-import org.jclouds.openstack.nova.v2_0.features.FlavorApi;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseFlavorDetails.Flavors;
-import org.jclouds.openstack.v2_0.domain.Link;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * boiler plate until we determine a better way
- */
-@Beta
-@Singleton
-public class ParseFlavorDetails extends ParseJson<Flavors> {
- static class Flavors extends PaginatedCollection<Flavor> {
-
- @ConstructorProperties({ "flavors", "flavors_links" })
- protected Flavors(Iterable<Flavor> flavors, Iterable<Link> flavors_links) {
- super(flavors, flavors_links);
- }
-
- }
-
- @Inject
- public ParseFlavorDetails(Json json) {
- super(json, TypeLiteral.get(Flavors.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<Flavor, ToPagedIterable> {
-
- private final NovaApi api;
-
- @Inject
- protected ToPagedIterable(NovaApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Flavor>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.get().toString();
- final FlavorApi flavorApi = api.getFlavorApiForZone(zone);
- return new Function<Object, IterableWithMarker<Flavor>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Flavor> apply(Object input) {
- PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
- return IterableWithMarker.class.cast(flavorApi.listInDetail(paginationOptions));
- }
-
- @Override
- public String toString() {
- return "listFlavorsInDetail()";
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavors.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavors.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavors.java
deleted file mode 100644
index 9b1b21c..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseFlavors.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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.common.base.Optional;
-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.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.features.FlavorApi;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseFlavors.Flavors;
-import org.jclouds.openstack.v2_0.domain.Link;
-import org.jclouds.openstack.v2_0.domain.Resource;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * boiler plate until we determine a better way
- */
-@Beta
-@Singleton
-public class ParseFlavors extends ParseJson<Flavors> {
- static class Flavors extends PaginatedCollection<Resource> {
-
- @ConstructorProperties({ "flavors", "flavors_links" })
- protected Flavors(Iterable<Resource> flavors, Iterable<Link> flavors_links) {
- super(flavors, flavors_links);
- }
-
- }
-
- @Inject
- public ParseFlavors(Json json) {
- super(json, TypeLiteral.get(Flavors.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<Resource, ToPagedIterable> {
-
- private final NovaApi api;
-
- @Inject
- protected ToPagedIterable(NovaApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Resource>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.get().toString();
- final FlavorApi flavorApi = api.getFlavorApiForZone(zone);
- return new Function<Object, IterableWithMarker<Resource>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Resource> apply(Object input) {
- PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
- return IterableWithMarker.class.cast(flavorApi.list(paginationOptions));
- }
-
- @Override
- public String toString() {
- return "listFlavors()";
- }
- };
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImageDetails.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImageDetails.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImageDetails.java
deleted file mode 100644
index 39b3984..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImageDetails.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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.common.base.Optional;
-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.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.domain.Image;
-import org.jclouds.openstack.nova.v2_0.features.ImageApi;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseImageDetails.Images;
-import org.jclouds.openstack.v2_0.domain.Link;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * boiler plate until we determine a better way
- */
-@Beta
-@Singleton
-public class ParseImageDetails 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 ParseImageDetails(Json json) {
- super(json, TypeLiteral.get(Images.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<Image, ToPagedIterable> {
-
- private final NovaApi api;
-
- @Inject
- protected ToPagedIterable(NovaApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Image>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.get().toString();
- final ImageApi imageApi = api.getImageApiForZone(zone);
- return new Function<Object, IterableWithMarker<Image>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Image> apply(Object input) {
- PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
- return IterableWithMarker.class.cast(imageApi.listInDetail(paginationOptions));
- }
-
- @Override
- public String toString() {
- return "listInDetail()";
- }
- };
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImages.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImages.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImages.java
deleted file mode 100644
index d4e1944..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseImages.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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.common.base.Optional;
-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.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.features.ImageApi;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseImages.Images;
-import org.jclouds.openstack.v2_0.domain.Link;
-import org.jclouds.openstack.v2_0.domain.Resource;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * boiler plate until we determine a better way
- */
-@Beta
-@Singleton
-public class ParseImages extends ParseJson<Images> {
- static class Images extends PaginatedCollection<Resource> {
-
- @ConstructorProperties({ "images", "images_links" })
- protected Images(Iterable<Resource> 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<Resource, ToPagedIterable> {
-
- private final NovaApi api;
-
- @Inject
- protected ToPagedIterable(NovaApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Resource>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.get().toString();
- final ImageApi imageApi = api.getImageApiForZone(zone);
- return new Function<Object, IterableWithMarker<Resource>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Resource> apply(Object input) {
- PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
- return IterableWithMarker.class.cast(imageApi.list(paginationOptions));
- }
-
- @Override
- public String toString() {
- return "list()";
- }
- };
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseKeyPairs.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseKeyPairs.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseKeyPairs.java
deleted file mode 100644
index ad84f9a..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseKeyPairs.java
+++ /dev/null
@@ -1,60 +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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseFirstJsonValueNamed;
-import org.jclouds.json.internal.GsonWrapper;
-import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.FluentIterable;
-import com.google.inject.Inject;
-import com.google.inject.TypeLiteral;
-
-@Singleton
-public class ParseKeyPairs implements Function<HttpResponse, FluentIterable<? extends KeyPair>> {
- private final ParseFirstJsonValueNamed<FluentIterable<Wrapper>> parser;
-
- private static class Wrapper implements Supplier<KeyPair> {
- private KeyPair keypair;
-
- @Override
- public KeyPair get() {
- return keypair;
- }
-
- }
-
- @Inject
- public ParseKeyPairs(GsonWrapper gsonView) {
- this.parser = new ParseFirstJsonValueNamed<FluentIterable<Wrapper>>(checkNotNull(gsonView, "gsonView"),
- new TypeLiteral<FluentIterable<Wrapper>>() {
- }, "keypairs");
- }
-
- public FluentIterable<? extends KeyPair> apply(HttpResponse response) {
- checkNotNull(response, "response");
- return parser.apply(response).transform(Suppliers.<KeyPair> supplierFunction());
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServerDetails.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServerDetails.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServerDetails.java
deleted file mode 100644
index e9389ca..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServerDetails.java
+++ /dev/null
@@ -1,92 +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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.common.base.Optional;
-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.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.domain.Server;
-import org.jclouds.openstack.nova.v2_0.features.ServerApi;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseServerDetails.Servers;
-import org.jclouds.openstack.v2_0.domain.Link;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * boiler plate until we determine a better way
- */
-@Beta
-@Singleton
-public class ParseServerDetails extends ParseJson<Servers> {
- static class Servers extends PaginatedCollection<Server> {
-
- @ConstructorProperties({ "servers", "servers_links" })
- protected Servers(Iterable<Server> servers, Iterable<Link> servers_links) {
- super(servers, servers_links);
- }
-
- }
-
- @Inject
- public ParseServerDetails(Json json) {
- super(json, TypeLiteral.get(Servers.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<Server, ToPagedIterable> {
-
- private final NovaApi api;
-
- @Inject
- protected ToPagedIterable(NovaApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Server>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.get().toString();
- final ServerApi serverApi = api.getServerApiForZone(zone);
- return new Function<Object, IterableWithMarker<Server>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Server> apply(Object input) {
- PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
- return IterableWithMarker.class.cast(serverApi.listInDetail(paginationOptions));
- }
-
- @Override
- public String toString() {
- return "listInDetail()";
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/a9834e9e/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServers.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServers.java b/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServers.java
deleted file mode 100644
index 15a932e..0000000
--- a/dependencies/jclouds/apis/openstack-nova/1.8.0-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/functions/internal/ParseServers.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.nova.v2_0.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.common.base.Optional;
-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.v2_0.domain.PaginatedCollection;
-import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.features.ServerApi;
-import org.jclouds.openstack.nova.v2_0.functions.internal.ParseServers.Servers;
-import org.jclouds.openstack.v2_0.domain.Link;
-import org.jclouds.openstack.v2_0.domain.Resource;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * boiler plate until we determine a better way
- */
-@Beta
-@Singleton
-public class ParseServers extends ParseJson<Servers> {
- static class Servers extends PaginatedCollection<Resource> {
-
- @ConstructorProperties({ "servers", "servers_links" })
- protected Servers(Iterable<Resource> servers, Iterable<Link> servers_links) {
- super(servers, servers_links);
- }
-
- }
-
- @Inject
- public ParseServers(Json json) {
- super(json, TypeLiteral.get(Servers.class));
- }
-
- public static class ToPagedIterable extends Arg0ToPagedIterable.FromCaller<Resource, ToPagedIterable> {
-
- private final NovaApi api;
-
- @Inject
- protected ToPagedIterable(NovaApi api) {
- this.api = checkNotNull(api, "api");
- }
-
- @Override
- protected Function<Object, IterableWithMarker<Resource>> markerToNextForArg0(Optional<Object> arg0) {
- String zone = arg0.get().toString();
- final ServerApi serverApi = api.getServerApiForZone(zone);
- return new Function<Object, IterableWithMarker<Resource>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public IterableWithMarker<Resource> apply(Object input) {
- PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
- return IterableWithMarker.class.cast(serverApi.list(paginationOptions));
- }
-
- @Override
- public String toString() {
- return "list()";
- }
- };
- }
-
- }
-
-}