http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java deleted file mode 100644 index 8f21287..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java +++ /dev/null @@ -1,204 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; - -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.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Network; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.functions.internal.ParseNetworks; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -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.SkipEncoding; -import org.jclouds.rest.annotations.Transform; -import org.jclouds.rest.binders.BindToJsonPayload; - -/** - * Provides access to Networks via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/networks"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -public interface NetworkApi { - - /** - * Returns the specified persistent network resource. - * - * @param networkName name of the persistent network resource to return. - * @return a Network resource. - */ - @Named("Networks:get") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks/{network}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - Network get(@PathParam("network") String networkName); - - /** - * Creates a persistent network resource in the specified project with the specified range. - * - * @param networkName the network name - * @param IPv4Range the range of the network to be inserted. - * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to - * you, and look for the status field. - */ - @Named("Networks:insert") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes({COMPUTE_SCOPE}) - @MapBinder(BindToJsonPayload.class) - Operation createInIPv4Range(@PayloadParam("name") String networkName, - @PayloadParam("IPv4Range") String IPv4Range); - - /** - * Creates a persistent network resource in the specified project with the specified range and specified gateway. - * - * @param networkName the network name - * @param IPv4Range the range of the network to be inserted. - * @param gatewayIPv4 the range of the network to be inserted. - * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to - * you, and look for the status field. - */ - @Named("Networks:insert") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes({COMPUTE_SCOPE}) - @MapBinder(BindToJsonPayload.class) - Operation createInIPv4RangeWithGateway(@PayloadParam("name") String networkName, - @PayloadParam("IPv4Range") String IPv4Range, - @PayloadParam("gatewayIPv4") String gatewayIPv4); - - /** - * Deletes the specified persistent network resource. - * - * @param networkName name of the persistent network resource to delete. - * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to - * you, and look for the status field. - */ - @Named("Networks:delete") - @DELETE - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks/{network}") - @OAuthScopes(COMPUTE_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - Operation delete(@PathParam("network") String networkName); - - /** - * @see NetworkApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Networks:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseNetworks.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Network> listFirstPage(); - - /** - * @see NetworkApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Networks:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseNetworks.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Network> listAtMarker(@QueryParam("pageToken") @Nullable String marker); - - /** - * Retrieves the list of persistent network resources contained within the specified project. - * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not - * been set. - * - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the list - * @see ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("Networks:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseNetworks.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Network> listAtMarker(@QueryParam("pageToken") @Nullable String marker, - ListOptions options); - - /** - * @see NetworkApi#list(org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Networks:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseNetworks.class) - @Transform(ParseNetworks.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Network> list(); - - /** - * A paged version of NetworkApi#list() - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see PagedIterable - * @see NetworkApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Networks:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/networks") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseNetworks.class) - @Transform(ParseNetworks.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Network> list(ListOptions options); -}
http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java deleted file mode 100644 index 8871593..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; - -import java.util.Map; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.domain.Project; -import org.jclouds.googlecomputeengine.handlers.MetadataBinder; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -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.SkipEncoding; - -/** - * Provides access to Projects via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/projects"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -public interface ProjectApi { - - /** - * Returns the specified project resource. - * - * @param projectName name of the project to return - * @return if successful, this method returns a Project resource - */ - @Named("Projects:get") - @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @Fallback(NullOnNotFoundOr404.class) - @Path("/projects/{project}") - Project get(@PathParam("project") String projectName); - - /** - * Sets metadata common to all instances within the specified project using the data included in the request. - * <p/> - * NOTE: This *sets* metadata items on the project (vs *adding* items to metadata), - * if there are pre-existing metadata items that must be kept these must be fetched first and then re-set on the - * new Metadata, e.g. - * <pre><tt> - * Metadata.Builder current = projectApi.get("myProject").getCommonInstanceMetadata().toBuilder(); - * current.addItem("newItem","newItemValue"); - * projectApi.setCommonInstanceMetadata(current.build()); - * </tt></pre> - * - * @param projectName name of the project to return - * @param metadata the metadata to set - * @param fingerprint The current fingerprint for the metadata - * @return an Operations resource. To check on the status of an operation, poll the Operations resource returned - * to you, and look for the status field. - */ - @Named("Projects:setCommonInstanceMetadata") - @POST - @Path("/projects/{project}/setCommonInstanceMetadata") - @OAuthScopes(COMPUTE_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @MapBinder(MetadataBinder.class) - Operation setCommonInstanceMetadata(@PathParam("project") String projectName, - @PayloadParam("items") Map<String, String> metadata, - @PayloadParam("fingerprint") String fingerprint); -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java deleted file mode 100644 index 608a614..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java +++ /dev/null @@ -1,135 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Region; -import org.jclouds.googlecomputeengine.functions.internal.ParseRegions; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Regions via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/regions"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -@Consumes(MediaType.APPLICATION_JSON) -public interface RegionApi { - - /** - * Returns the specified region resource - * - * @param regionName name of the region resource to return. - * @return If successful, this method returns a Region resource - */ - @Named("Regions:get") - @GET - @Path("/regions/{region}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - Region get(@PathParam("region") String regionName); - - /** - * @see org.jclouds.googlecomputeengine.features.RegionApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Regions:list") - @GET - @Path("/regions") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRegions.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Region> listFirstPage(); - - /** - * @see org.jclouds.googlecomputeengine.features.RegionApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Regions:list") - @GET - @Path("/regions") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRegions.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Region> listAtMarker(String marker); - - /** - * Retrieves the listFirstPage of region resources available to the specified project. - * By default the listFirstPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() - * has not been set. - * - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the listFirstPage - * @see org.jclouds.googlecomputeengine.options.ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("Regions:list") - @GET - @Path("/regions") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRegions.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Region> listAtMarker(String marker, ListOptions listOptions); - - /** - * @see org.jclouds.googlecomputeengine.features.RegionApi#list(org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Regions:list") - @GET - @Path("/regions") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRegions.class) - @Transform(ParseRegions.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Region> list(); - - /** - * A paged version of RegionApi#listFirstPage() - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see org.jclouds.googlecomputeengine.features.RegionApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - * @see org.jclouds.collect.PagedIterable - */ - @Named("Regions:list") - @GET - @Path("/regions") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRegions.class) - @Transform(ParseRegions.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Region> list(ListOptions listOptions); -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java deleted file mode 100644 index 4afab63..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java +++ /dev/null @@ -1,163 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.functions.internal.ParseRegionOperations; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Operations via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/operations"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -public interface RegionOperationApi { - - /** - * Retrieves the specified operation resource. - * - * @param region the region the operation is in - * @param operationName name of the operation resource to return. - * @return If successful, this method returns an Operation resource - */ - @Named("RegionOperations:get") - @GET - @Path("/regions/{region}/operations/{operation}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @Fallback(NullOnNotFoundOr404.class) - Operation getInRegion(@PathParam("region") String region, @PathParam("operation") String operationName); - - /** - * Deletes the specified operation resource. - * - * @param region the region the operation is in - * @param operationName name of the operation resource to delete. - */ - @Named("RegionOperations:delete") - @DELETE - @Path("/regions/{region}/operations/{operation}") - @OAuthScopes(COMPUTE_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - void deleteInRegion(@PathParam("region") String region, @PathParam("operation") String operationName); - - /** - * @see org.jclouds.googlecomputeengine.features.RegionOperationApi#listAtMarkerInRegion(String, String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("RegionOperations:list") - @GET - @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseRegionOperations.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Operation> listFirstPageInRegion(@PathParam("region") String region); - - /** - * @see org.jclouds.googlecomputeengine.features.RegionOperationApi#listAtMarkerInRegion(String, String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("RegionOperations:list") - @GET - @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseRegionOperations.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Operation> listAtMarkerInRegion(@PathParam("region") String region, - @QueryParam("pageToken") @Nullable String marker); - - /** - * Retrieves the listFirstPage of operation resources contained within the specified project. - * By default the listFirstPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() - * has not been set. - * - * @param region the region to list in - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the list, starting at marker - * @see org.jclouds.googlecomputeengine.options.ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("RegionOperations:list") - @GET - @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseRegionOperations.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Operation> listAtMarkerInRegion(@PathParam("region") String region, - @QueryParam("pageToken") @Nullable String marker, - ListOptions listOptions); - - /** - * @see org.jclouds.googlecomputeengine.features.RegionOperationApi#listInRegion(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("RegionOperations:list") - @GET - @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseRegionOperations.class) - @Transform(ParseRegionOperations.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Operation> listInRegion(@PathParam("region") String region); - - /** - * A paged version of RegionOperationApi#listFirstPageInRegion(String) - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see org.jclouds.collect.PagedIterable - * @see org.jclouds.googlecomputeengine.features.RegionOperationApi#listAtMarkerInRegion(String, String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("RegionOperations:list") - @GET - @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseRegionOperations.class) - @Transform(ParseRegionOperations.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Operation> listInRegion(@PathParam("region") String region, ListOptions listOptions); - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java deleted file mode 100644 index 3d208af..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java +++ /dev/null @@ -1,184 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; - -import java.net.URI; - -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.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.domain.Route; -import org.jclouds.googlecomputeengine.functions.internal.ParseRoutes; -import org.jclouds.googlecomputeengine.handlers.RouteBinder; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.googlecomputeengine.options.RouteOptions; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -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.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Routes via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/routess"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -@Consumes(MediaType.APPLICATION_JSON) -public interface RouteApi { - - /** - * Returns the specified route resource - * - * @param routeName name of the region resource to return. - * @return If successful, this method returns a Route resource - */ - @Named("Routes:get") - @GET - @Path("/global/routes/{route}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - Route get(@PathParam("route") String routeName); - - /** - * @see org.jclouds.googlecomputeengine.features.RouteApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Routes:list") - @GET - @Path("/global/routes") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRoutes.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Route> listFirstPage(); - - /** - * @see org.jclouds.googlecomputeengine.features.RouteApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Routes:list") - @GET - @Path("/global/routes") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRoutes.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Route> listAtMarker(String marker); - - /** - * Retrieves the listFirstPage of route resources available to the specified project. - * By default the listFirstPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() - * has not been set. - * - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the listFirstPage - * @see org.jclouds.googlecomputeengine.options.ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("Routes:list") - @GET - @Path("/global/routes") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRoutes.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Route> listAtMarker(String marker, ListOptions listOptions); - - /** - * @see org.jclouds.googlecomputeengine.features.RouteApi#list(org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Routes:list") - @GET - @Path("/global/routes") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRoutes.class) - @Transform(ParseRoutes.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Route> list(); - - /** - * A paged version of RegionApi#listFirstPage() - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see org.jclouds.googlecomputeengine.features.RouteApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - * @see org.jclouds.collect.PagedIterable - */ - @Named("Routes:list") - @GET - @Path("/global/routes") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseRoutes.class) - @Transform(ParseRoutes.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Route> list(ListOptions listOptions); - - /** - * Deletes the specified route resource. - * - * @param routeName name of the route resource to delete. - * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to - * you, and look for the status field. If the route did not exist the result is null. - */ - @Named("Routes:delete") - @DELETE - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/routes/{route}") - @OAuthScopes(COMPUTE_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - @Nullable - Operation delete(@PathParam("route") String routeName); - - /** - * Creates a route resource in the specified project using the data included in the request. - * - * @param name the name of the route to be inserted. - * @param network the network to which to add the route - * @param routeOptions the options of the route to add - * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to - * you, and look for the status field. - */ - @Named("Routes:insert") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @Path("/global/routes") - @OAuthScopes({COMPUTE_SCOPE}) - @MapBinder(RouteBinder.class) - Operation createInNetwork(@PayloadParam("name") String name, - @PayloadParam("network") URI network, - @PayloadParam("options") RouteOptions routeOptions); - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java deleted file mode 100644 index e0ac384..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java +++ /dev/null @@ -1,160 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.domain.Snapshot; -import org.jclouds.googlecomputeengine.functions.internal.ParseSnapshots; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Snapshots via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/snapshots"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -public interface SnapshotApi { - - /** - * Returns the specified snapshot resource. - * - * @param snapshotName name of the snapshot resource to return. - * @return a Snapshot resource. - */ - @Named("Snapshots:get") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots/{snapshot}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - @Nullable - Snapshot get(@PathParam("snapshot") String snapshotName); - - /** - * Deletes the specified snapshot resource. - * - * @param snapshotName name of the snapshot resource to delete. - * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to - * you, and look for the status field. - */ - @Named("Snapshots:delete") - @DELETE - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots/{snapshot}") - @OAuthScopes(COMPUTE_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - @Nullable - Operation delete(@PathParam("snapshot") String snapshotName); - - /** - * @see org.jclouds.googlecomputeengine.features.SnapshotApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Snapshots:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseSnapshots.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Snapshot> listFirstPage(); - - /** - * @see org.jclouds.googlecomputeengine.features.SnapshotApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Snapshots:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseSnapshots.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Snapshot> listAtMarker(@QueryParam("pageToken") @Nullable String marker); - - /** - * Retrieves the listPage of persistent disk resources contained within the specified project and zone. - * By default the listPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has - * not been set. - * - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the listPage - * @see org.jclouds.googlecomputeengine.options.ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("Snapshots:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseSnapshots.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Snapshot> listAtMarker(@QueryParam("pageToken") @Nullable String marker, ListOptions listOptions); - - /** - * A paged version of SnapshotApi#listPage(String) - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see org.jclouds.collect.PagedIterable - * @see org.jclouds.googlecomputeengine.features.SnapshotApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Snapshots:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseSnapshots.class) - @Transform(ParseSnapshots.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Snapshot> list(); - - @Named("Snapshots:list") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Path("/global/snapshots") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseSnapshots.class) - @Transform(ParseSnapshots.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Snapshot> list(ListOptions options); - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java deleted file mode 100644 index 26d10a6..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java +++ /dev/null @@ -1,135 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Zone; -import org.jclouds.googlecomputeengine.functions.internal.ParseZones; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Zones via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/zones"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -@Consumes(MediaType.APPLICATION_JSON) -public interface ZoneApi { - - /** - * Returns the specified zone resource - * - * @param zoneName name of the zone resource to return. - * @return If successful, this method returns a Zone resource - */ - @Named("Zones:get") - @GET - @Path("/zones/{zone}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - Zone get(@PathParam("zone") String zoneName); - - /** - * @see ZoneApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Zones:list") - @GET - @Path("/zones") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseZones.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Zone> listFirstPage(); - - /** - * @see ZoneApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Zones:list") - @GET - @Path("/zones") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseZones.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Zone> listAtMarker(String marker); - - /** - * Retrieves the listFirstPage of zone resources available to the specified project. - * By default the listFirstPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() - * has not been set. - * - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the listFirstPage - * @see ListOptions - * @see ListPage - */ - @Named("Zones:list") - @GET - @Path("/zones") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseZones.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Zone> listAtMarker(String marker, ListOptions listOptions); - - /** - * @see ZoneApi#list(org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Zones:list") - @GET - @Path("/zones") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseZones.class) - @Transform(ParseZones.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Zone> list(); - - /** - * A paged version of ZoneApi#listFirstPage() - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see ZoneApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - * @see PagedIterable - */ - @Named("Zones:list") - @GET - @Path("/zones") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseZones.class) - @Transform(ParseZones.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Zone> list(ListOptions listOptions); -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java deleted file mode 100644 index 3dd69e1..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java +++ /dev/null @@ -1,163 +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.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.functions.internal.ParseZoneOperations; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Operations via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/operations"/> - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticationFilter.class) -public interface ZoneOperationApi { - - /** - * Retrieves the specified operation resource. - * - * @param zone the zone the operation is in - * @param operationName name of the operation resource to return. - * @return If successful, this method returns an Operation resource - */ - @Named("ZoneOperations:get") - @GET - @Path("/zones/{zone}/operations/{operation}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @Fallback(NullOnNotFoundOr404.class) - Operation getInZone(@PathParam("zone") String zone, @PathParam("operation") String operationName); - - /** - * Deletes the specified operation resource. - * - * @param zone the zone the operation is in - * @param operationName name of the operation resource to delete. - */ - @Named("ZoneOperations:delete") - @DELETE - @Path("/zones/{zone}/operations/{operation}") - @OAuthScopes(COMPUTE_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - void deleteInZone(@PathParam("zone") String zone, @PathParam("operation") String operationName); - - /** - * @see ZoneOperationApi#listAtMarkerInZone(String, String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("ZoneOperations:list") - @GET - @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseZoneOperations.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Operation> listFirstPageInZone(@PathParam("zone") String zone); - - /** - * @see ZoneOperationApi#listAtMarkerInZone(String, String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("ZoneOperations:list") - @GET - @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseZoneOperations.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Operation> listAtMarkerInZone(@PathParam("zone") String zone, - @QueryParam("pageToken") @Nullable String marker); - - /** - * Retrieves the listFirstPage of operation resources contained within the specified project. - * By default the listFirstPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() - * has not been set. - * - * @param zone the zone to list in - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the list, starting at marker - * @see ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("ZoneOperations:list") - @GET - @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseZoneOperations.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage<Operation> listAtMarkerInZone(@PathParam("zone") String zone, - @QueryParam("pageToken") @Nullable String marker, - ListOptions listOptions); - - /** - * @see ZoneOperationApi#listInZone(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("ZoneOperations:list") - @GET - @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseZoneOperations.class) - @Transform(ParseZoneOperations.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Operation> listInZone(@PathParam("zone") String zone); - - /** - * A paged version of ZoneOperationApi#listFirstPageInZone(String) - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see PagedIterable - * @see ZoneOperationApi#listAtMarkerInZone(String, String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("ZoneOperations:list") - @GET - @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Consumes(MediaType.APPLICATION_JSON) - @ResponseParser(ParseZoneOperations.class) - @Transform(ParseZoneOperations.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable<Operation> listInZone(@PathParam("zone") String zone, ListOptions listOptions); - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java deleted file mode 100644 index c6bc1ac..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java +++ /dev/null @@ -1,100 +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.googlecomputeengine.functions; - -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; -import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_INTERVAL; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_TIMEOUT; -import static org.jclouds.util.Predicates2.retry; - -import java.util.concurrent.atomic.AtomicReference; - -import javax.annotation.Resource; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; - -import org.jclouds.compute.reference.ComputeServiceConstants; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.config.UserProject; -import org.jclouds.googlecomputeengine.domain.Network; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.domain.internal.NetworkAndAddressRange; -import org.jclouds.logging.Logger; - -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.google.common.base.Supplier; -import com.google.common.util.concurrent.Atomics; - -@Singleton -public class CreateNetworkIfNeeded implements Function<NetworkAndAddressRange, Network> { - @Resource - @Named(ComputeServiceConstants.COMPUTE_LOGGER) - protected Logger logger = Logger.NULL; - - protected final GoogleComputeEngineApi api; - protected final Supplier<String> userProject; - private final Predicate<AtomicReference<Operation>> operationDonePredicate; - private final long operationCompleteCheckInterval; - private final long operationCompleteCheckTimeout; - - @Inject - public CreateNetworkIfNeeded(GoogleComputeEngineApi api, - @UserProject Supplier<String> userProject, - @Named("global") Predicate<AtomicReference<Operation>> operationDonePredicate, - @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval, - @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout) { - this.api = checkNotNull(api, "api"); - this.userProject = checkNotNull(userProject, "userProject"); - this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval, - "operation completed check interval"); - this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout, - "operation completed check timeout"); - this.operationDonePredicate = checkNotNull(operationDonePredicate, "operationDonePredicate"); - } - - @Override - public Network apply(NetworkAndAddressRange input) { - checkNotNull(input, "input"); - - Network nw = api.getNetworkApiForProject(userProject.get()).get(input.getName()); - if (nw != null) { - return nw; - } - - if (input.getGateway().isPresent()) { - AtomicReference<Operation> operation = Atomics.newReference(api.getNetworkApiForProject(userProject - .get()).createInIPv4RangeWithGateway(input.getName(), input.getIpV4Range(), input.getGateway().get())); - retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval, - MILLISECONDS).apply(operation); - - checkState(!operation.get().getHttpError().isPresent(), "Could not create network, operation failed" + operation); - } else { - AtomicReference<Operation> operation = Atomics.newReference(api.getNetworkApiForProject(userProject - .get()).createInIPv4Range(input.getName(), input.getIpV4Range())); - retry(operationDonePredicate, operationCompleteCheckTimeout, operationCompleteCheckInterval, - MILLISECONDS).apply(operation); - - checkState(!operation.get().getHttpError().isPresent(), "Could not create network, operation failed" + operation); - } - return checkNotNull(api.getNetworkApiForProject(userProject.get()).get(input.getName()), - "no network with name %s was found", input.getName()); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToPagedIterable.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToPagedIterable.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToPagedIterable.java deleted file mode 100644 index 588be0a..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToPagedIterable.java +++ /dev/null @@ -1,66 +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.googlecomputeengine.functions.internal; - -import static com.google.common.base.Predicates.instanceOf; -import static com.google.common.collect.Iterables.tryFind; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.collect.PagedIterable; -import org.jclouds.collect.PagedIterables; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.InvocationContext; -import org.jclouds.rest.internal.GeneratedHttpRequest; - -import com.google.common.annotations.Beta; -import com.google.common.base.Function; -import com.google.common.base.Optional; - -@Beta -public abstract class BaseToPagedIterable<T, I extends BaseToPagedIterable<T, I>> implements - Function<ListPage<T>, PagedIterable<T>>, InvocationContext<I> { - - private GeneratedHttpRequest request; - - @Override - public PagedIterable<T> apply(ListPage<T> input) { - if (input.nextMarker() == null) - return PagedIterables.of(input); - - Optional<Object> project = tryFind(request.getCaller().get().getArgs(), instanceOf(String.class)); - - Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class)); - - assert project.isPresent() : String.format("programming error, method %s should have a string param for the " - + "project", request.getCaller().get().getInvokable()); - - return PagedIterables.advance( - input, fetchNextPage(project.get().toString(), (ListOptions) listOptions.orNull())); - } - - protected abstract Function<Object, IterableWithMarker<T>> fetchNextPage(String projectName, - ListOptions listOptions); - - @SuppressWarnings("unchecked") - @Override - public I setContext(HttpRequest request) { - this.request = GeneratedHttpRequest.class.cast(request); - return (I) this; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToPagedIterable.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToPagedIterable.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToPagedIterable.java deleted file mode 100644 index a4cc52d..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToPagedIterable.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.functions.internal; - -import static com.google.common.base.Predicates.instanceOf; -import static com.google.common.collect.Iterables.tryFind; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.collect.PagedIterable; -import org.jclouds.collect.PagedIterables; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.InvocationContext; -import org.jclouds.rest.internal.GeneratedHttpRequest; - -import com.google.common.annotations.Beta; -import com.google.common.base.Function; -import com.google.common.base.Optional; - -@Beta -public abstract class BaseWithRegionToPagedIterable<T, I extends BaseWithRegionToPagedIterable<T, I>> implements - Function<ListPage<T>, PagedIterable<T>>, InvocationContext<I> { - - private GeneratedHttpRequest request; - - @Override - public PagedIterable<T> apply(ListPage<T> input) { - if (input.nextMarker() == null) - return PagedIterables.of(input); - - Optional <Object> project = tryFind(request.getCaller().get().getArgs(), instanceOf(String.class)); - - Optional<Object> region = tryFind(request.getInvocation().getArgs(), instanceOf(String.class)); - - Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class)); - - assert project.isPresent() : String.format("programming error, method %s should have a string param for the " - + "project", request.getCaller().get().getInvokable()); - - assert region.isPresent() : String.format("programming error, method %s should have a string param for the " - + "region", request.getCaller().get().getInvokable()); - - return PagedIterables.advance( - input, fetchNextPage(project.get().toString(), region.get().toString(), (ListOptions) listOptions.orNull())); - } - - protected abstract Function<Object, IterableWithMarker<T>> fetchNextPage(String projectName, - String regionName, - ListOptions listOptions); - - @SuppressWarnings("unchecked") - @Override - public I setContext(HttpRequest request) { - this.request = GeneratedHttpRequest.class.cast(request); - return (I) this; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToPagedIterable.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToPagedIterable.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToPagedIterable.java deleted file mode 100644 index d9dcbf2..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToPagedIterable.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.functions.internal; - -import static com.google.common.base.Predicates.instanceOf; -import static com.google.common.collect.Iterables.tryFind; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.collect.PagedIterable; -import org.jclouds.collect.PagedIterables; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.InvocationContext; -import org.jclouds.rest.internal.GeneratedHttpRequest; - -import com.google.common.annotations.Beta; -import com.google.common.base.Function; -import com.google.common.base.Optional; - -@Beta -public abstract class BaseWithZoneToPagedIterable<T, I extends BaseWithZoneToPagedIterable<T, I>> implements - Function<ListPage<T>, PagedIterable<T>>, InvocationContext<I> { - - private GeneratedHttpRequest request; - - @Override - public PagedIterable<T> apply(ListPage<T> input) { - if (input.nextMarker() == null) - return PagedIterables.of(input); - - Optional<Object> project = tryFind(request.getCaller().get().getArgs(), instanceOf(String.class)); - - Optional<Object> zone = tryFind(request.getInvocation().getArgs(), instanceOf(String.class)); - - Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class)); - - assert project.isPresent() : String.format("programming error, method %s should have a string param for the " - + "project", request.getCaller().get().getInvokable()); - - assert zone.isPresent() : String.format("programming error, method %s should have a string param for the " - + "zone", request.getCaller().get().getInvokable()); - - return PagedIterables.advance( - input, fetchNextPage(project.get().toString(), zone.get().toString(), (ListOptions) listOptions.orNull())); - } - - protected abstract Function<Object, IterableWithMarker<T>> fetchNextPage(String projectName, - String zoneName, - ListOptions listOptions); - - @SuppressWarnings("unchecked") - @Override - public I setContext(HttpRequest request) { - this.request = GeneratedHttpRequest.class.cast(request); - return (I) this; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java deleted file mode 100644 index 4e287dc..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.functions.internal; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import javax.ws.rs.HttpMethod; - -/** - * Indicates that the annotated method responds to HTTP PATCH requests - * - * @see javax.ws.rs.HttpMethod - */ -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod("PATCH") -public @interface PATCH { -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java deleted file mode 100644 index 59b4408..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java +++ /dev/null @@ -1,67 +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.googlecomputeengine.functions.internal; - -import static com.google.common.base.Preconditions.checkNotNull; - -import javax.inject.Inject; -import javax.inject.Singleton; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.domain.Address; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.functions.ParseJson; -import org.jclouds.json.Json; - -import com.google.common.base.Function; -import com.google.inject.TypeLiteral; - -@Singleton -public class ParseAddresses extends ParseJson<ListPage<Address>> { - - @Inject - public ParseAddresses(Json json) { - super(json, new TypeLiteral<ListPage<Address>>() { - }); - } - - public static class ToPagedIterable extends BaseWithRegionToPagedIterable<Address, ToPagedIterable> { - - private final GoogleComputeEngineApi api; - - @Inject - protected ToPagedIterable(GoogleComputeEngineApi api) { - this.api = checkNotNull(api, "api"); - } - - @Override - protected Function<Object, IterableWithMarker<Address>> fetchNextPage(final String projectName, - final String regionName, - final ListOptions options) { - return new Function<Object, IterableWithMarker<Address>>() { - - @Override - public IterableWithMarker<Address> apply(Object input) { - return api.getAddressApiForProject(projectName) - .listAtMarkerInRegion(regionName, input.toString(), options); - } - }; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java deleted file mode 100644 index eca4a11..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java +++ /dev/null @@ -1,67 +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.googlecomputeengine.functions.internal; - -import static com.google.common.base.Preconditions.checkNotNull; - -import javax.inject.Inject; -import javax.inject.Singleton; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.domain.Disk; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.functions.ParseJson; -import org.jclouds.json.Json; - -import com.google.common.base.Function; -import com.google.inject.TypeLiteral; - -@Singleton -public class ParseDisks extends ParseJson<ListPage<Disk>> { - - @Inject - public ParseDisks(Json json) { - super(json, new TypeLiteral<ListPage<Disk>>() { - }); - } - - public static class ToPagedIterable extends BaseWithZoneToPagedIterable<Disk, ToPagedIterable> { - - private final GoogleComputeEngineApi api; - - @Inject - protected ToPagedIterable(GoogleComputeEngineApi api) { - this.api = checkNotNull(api, "api"); - } - - @Override - protected Function<Object, IterableWithMarker<Disk>> fetchNextPage(final String projectName, - final String zoneName, - final ListOptions options) { - return new Function<Object, IterableWithMarker<Disk>>() { - - @Override - public IterableWithMarker<Disk> apply(Object input) { - return api.getDiskApiForProject(projectName) - .listAtMarkerInZone(zoneName, input.toString(), options); - } - }; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java deleted file mode 100644 index 05d11bd..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.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.googlecomputeengine.functions.internal; - -import static com.google.common.base.Preconditions.checkNotNull; - -import javax.inject.Inject; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.domain.Firewall; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.functions.ParseJson; -import org.jclouds.json.Json; - -import com.google.common.base.Function; -import com.google.inject.TypeLiteral; - -public class ParseFirewalls extends ParseJson<ListPage<Firewall>> { - - @Inject - public ParseFirewalls(Json json) { - super(json, new TypeLiteral<ListPage<Firewall>>() { - }); - } - - public static class ToPagedIterable extends BaseToPagedIterable<Firewall, ToPagedIterable> { - - private final GoogleComputeEngineApi api; - - @Inject - protected ToPagedIterable(GoogleComputeEngineApi api) { - this.api = checkNotNull(api, "api"); - } - - @Override - protected Function<Object, IterableWithMarker<Firewall>> fetchNextPage(final String projectName, - final ListOptions options) { - return new Function<Object, IterableWithMarker<Firewall>>() { - - @Override - public IterableWithMarker<Firewall> apply(Object input) { - return api.getFirewallApiForProject(projectName).listAtMarker(input.toString(), options); - } - }; - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java b/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java deleted file mode 100644 index b2a589e..0000000 --- a/dependencies/jclouds/apis/gce/1.8.1-stratos/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.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.googlecomputeengine.functions.internal; - -import static com.google.common.base.Preconditions.checkNotNull; - -import javax.inject.Inject; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.functions.ParseJson; -import org.jclouds.json.Json; - -import com.google.common.base.Function; -import com.google.inject.TypeLiteral; - -public class ParseGlobalOperations extends ParseJson<ListPage<Operation>> { - - @Inject - public ParseGlobalOperations(Json json) { - super(json, new TypeLiteral<ListPage<Operation>>() { - }); - } - - public static class ToPagedIterable extends BaseToPagedIterable<Operation, ToPagedIterable> { - - private final GoogleComputeEngineApi api; - - @Inject - protected ToPagedIterable(GoogleComputeEngineApi api) { - this.api = checkNotNull(api, "api"); - } - - @Override - protected Function<Object, IterableWithMarker<Operation>> fetchNextPage(final String projectName, - final ListOptions options) { - return new Function<Object, IterableWithMarker<Operation>>() { - - @Override - public IterableWithMarker<Operation> apply(Object input) { - return api.getGlobalOperationApiForProject(projectName).listAtMarker(input.toString(), options); - } - }; - } - } -}
