http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java index d363715..e142d7a 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java @@ -53,8 +53,6 @@ import org.jclouds.rest.binders.BindToJsonPayload; /** * Provides access to Addresses via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/addresses"/> */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticationFilter.class)
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java index 266bff8..ba3c3f1 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java @@ -55,8 +55,6 @@ import org.jclouds.rest.binders.BindToJsonPayload; /** * Provides access to Disks via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/disks"/> */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticationFilter.class) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java index 9dcc35b..33d2e41 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java @@ -60,9 +60,6 @@ import org.jclouds.rest.binders.BindToJsonPayload; /** * Provides access to Firewalls via their REST API. - * <p/> - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/firewalls"/> */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticationFilter.class) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java new file mode 100644 index 0000000..c474286 --- /dev/null +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java @@ -0,0 +1,197 @@ +/* + * 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 org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; +import org.jclouds.Fallbacks.NullOnNotFoundOr404; +import org.jclouds.collect.IterableWithMarker; +import org.jclouds.collect.PagedIterable; +import org.jclouds.googlecomputeengine.domain.ForwardingRule; +import org.jclouds.googlecomputeengine.domain.Operation; +import org.jclouds.googlecomputeengine.functions.internal.ParseForwardingRules; +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.OAuthAuthenticator; +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; + +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 java.net.URI; + +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; + +/** + * Provides access to ForwardingRules via their REST API. + */ +@SkipEncoding({'/', '='}) +@RequestFilters(OAuthAuthenticator.class) +@Consumes(MediaType.APPLICATION_JSON) +public interface ForwardingRuleApi { + + /** + * Returns the specified ForwardingRule resource. + * + * @param forwardingRule the name of the ForwardingRule resource to return. + * @return a ForwardingRule resource. + */ + @Named("ForwardingRules:get") + @GET + @Path("/forwardingRules/{forwardingRule}") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @Nullable + ForwardingRule get(@PathParam("forwardingRule") String forwardingRule); + + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * @param forwardingRuleName the name of the forwarding rule. + * @param targetSelfLink the URL of the target resource to receive the matched traffic. The target resource must live + * in the same region as this forwarding rule. + * @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("ForwardingRules:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/forwardingRules") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String forwardingRuleName, + @PayloadParam("target") URI targetSelfLink); + + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * @param forwardingRuleName the name of the forwarding rule. + * @param targetSelfLink the URL of the target resource to receive the matched traffic. The target resource must live + * in the same region as this forwarding rule. + * @param portRange If IPProtocol is TCP or UDP, packets addressed to ports in the specified range will be + * forwarded to backend. By default, this is empty and all ports are allowed. + * @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("ForwardingRules:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/forwardingRules") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String forwardingRuleName, + @PayloadParam("target") URI targetSelfLink, + @PayloadParam("portRange") String portRange); + + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * @param forwardingRuleName the name of the forwarding rule. + * @param targetSelfLink the URL of the target resource to receive the matched traffic. The target resource must live + * in the same region as this forwarding rule. + * @param portRange If IPProtocol is TCP or UDP, packets addressed to ports in the specified range will be + * forwarded to backend. By default, this is empty and all ports are allowed. + * @param ipAddress the external IP address that this forwarding rule is serving on behalf of. If this is a + * reserved address, the address must live in the same region as the forwarding rule. By default, this field is empty and an ephemeral IP is assigned to the ForwardingRule. + * @param ipProtocol the IP protocol to which this rule applies. If left empty, the default value used is TCP. + * @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("ForwardingRules:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/forwardingRules") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String forwardingRuleName, + @PayloadParam("target") URI targetSelfLink, + @PayloadParam("portRange") String portRange, + @PayloadParam("IPAddress") String ipAddress, + @PayloadParam("IPProtocol") String ipProtocol); + + /** + * Deletes the specified TargetPool resource. + * + * @param forwardingRule name of the persistent forwarding rule 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("ForwardingRules:delete") + @DELETE + @Path("/forwardingRules/{forwardingRule}") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @Nullable + Operation delete(@PathParam("forwardingRule") String forwardingRule); + + + /** + * @return a Paged, Fluent Iterable that is able to fetch additional pages when required + * @see org.jclouds.collect.PagedIterable + */ + @Named("ForwardingRules:list") + @GET + @Path("/forwardingRules") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @ResponseParser(ParseForwardingRules.class) + @Transform(ParseForwardingRules.ToPagedIterable.class) + @Fallback(EmptyPagedIterableOnNotFoundOr404.class) + PagedIterable<ForwardingRule> list(); + + @Named("ForwardingRules:list") + @GET + @Path("/forwardingRules") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @ResponseParser(ParseForwardingRules.class) + @Fallback(EmptyPagedIterableOnNotFoundOr404.class) + IterableWithMarker<ForwardingRule> list(ListOptions options); + + /** + * Changes the target url for a forwarding rule. + * + * @param forwardingRule the name of the ForwardingRule resource in which target is to be set. + * @param target The URL of the target resource to receive traffic from this forwarding rule. + * It must live in the same region as this forwarding rule. + * + * @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("ForwardingRules:setTarget") + @POST + @Path("/forwardingRules/{forwardingRule}/setTarget") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @MapBinder(BindToJsonPayload.class) + @Nullable + Operation setTarget(@PathParam("forwardingRule") String forwardingRule, + @PayloadParam("target") String target); +} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java index 818ae86..77a57b8 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java @@ -47,8 +47,6 @@ import org.jclouds.rest.annotations.Transform; /** * Provides access to Global Operations via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/globalOperations"/> */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticationFilter.class) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java new file mode 100644 index 0000000..d562827 --- /dev/null +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java @@ -0,0 +1,160 @@ +/* + * 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 org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; +import org.jclouds.Fallbacks.NullOnNotFoundOr404; +import org.jclouds.collect.IterableWithMarker; +import org.jclouds.collect.PagedIterable; +import org.jclouds.googlecomputeengine.domain.HttpHealthCheck; +import org.jclouds.googlecomputeengine.domain.Operation; +import org.jclouds.googlecomputeengine.functions.internal.ParseHttpHealthChecks; +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.OAuthAuthenticator; +import org.jclouds.rest.annotations.Fallback; +import org.jclouds.rest.annotations.MapBinder; +import org.jclouds.rest.annotations.PATCH; +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; + +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 static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; + +/** + * Provides access to HttpHealthChecks via their REST API. + */ +@SkipEncoding({'/', '='}) +@RequestFilters(OAuthAuthenticator.class) +@Consumes(MediaType.APPLICATION_JSON) +public interface HttpHealthCheckApi { + + /** + * Returns the specified HttpHealthCheck resource. + * + * @param httpHealthCheck the name of the HttpHealthCheck resource to return. + * @return a HttpHealthCheck resource. + */ + @Named("HttpHealthChecks:get") + @GET + @Path("/{httpHealthCheck}") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @Nullable + HttpHealthCheck get(@PathParam("httpHealthCheck") String httpHealthCheck); + + /** + * Creates a HttpHealthCheck resource in the specified project and region using the data included in the request. + * + * @param httpHealthCheckName the name of the forwarding rule. + * @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("HttpHealthChecks:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + @Fallback(NullOnNotFoundOr404.class) + Operation insert(@PayloadParam("name") String httpHealthCheckName); + + /** + * Creates a HttpHealthCheck resource in the specified project and region using the data included in the request. + * + * @param httpHealthCheckName the name of the forwarding rule. + * @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("HttpHealthChecks:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + @Fallback(NullOnNotFoundOr404.class) + Operation insert(@PayloadParam("name") String httpHealthCheckName, @PayloadParam("timeoutSec") int + timeoutSec, @PayloadParam("unhealthyThreshold") int unhealthyThreshold); + + /** + * Deletes the specified TargetPool resource. + * + * @param httpHealthCheck name of the persistent forwarding rule 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("HttpHealthChecks:delete") + @DELETE + @Path("/{httpHealthCheck}") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @Nullable + Operation delete(@PathParam("httpHealthCheck") String httpHealthCheck); + + /** + * @return a Paged, Fluent Iterable that is able to fetch additional pages when required + * @see org.jclouds.collect.PagedIterable + */ + @Named("HttpHealthChecks:list") + @GET + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @ResponseParser(ParseHttpHealthChecks.class) + @Transform(ParseHttpHealthChecks.ToPagedIterable.class) + @Fallback(EmptyPagedIterableOnNotFoundOr404.class) + PagedIterable<HttpHealthCheck> list(); + + /** + * @param options @see org.jclouds.googlecomputeengine.options.ListOptions + * @return IterableWithMarker + */ + @Named("HttpHealthChecks:list") + @GET + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @ResponseParser(ParseHttpHealthChecks.class) + @Fallback(EmptyPagedIterableOnNotFoundOr404.class) + IterableWithMarker<HttpHealthCheck> list(ListOptions options); + + /** + * Changes target url for forwarding rule. + * + * @param httpHealthCheck the name of the HttpHealthCheck resource to update. + * + * @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("HttpHealthChecks:patch") + @PATCH + @Path("/{httpHealthCheck}") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @MapBinder(BindToJsonPayload.class) + @Nullable + Operation patch(@PathParam("httpHealthCheck") String httpHealthCheck); +} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java index f52d5cd..deaf7dc 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java @@ -53,9 +53,6 @@ import org.jclouds.rest.binders.BindToJsonPayload; /** * Provides access to Images via their REST API. - * <p/> - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/images"/> */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticationFilter.class) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java index aaa2d04..1585679 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java @@ -61,8 +61,6 @@ import org.jclouds.rest.binders.BindToJsonPayload; /** * Provides access to Instances via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/instances"/> * @see InstanceApi */ @SkipEncoding({'/', '='}) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java index 9c0e411..8977fbe 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java @@ -45,8 +45,6 @@ import org.jclouds.rest.annotations.Transform; /** * Provides access to MachineTypes via their REST API. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/machineTypes"/> */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticationFilter.class) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java index 8f21287..bee6861 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java @@ -53,8 +53,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java index eed0417..59cb5a0 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java @@ -44,8 +44,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java index 608a614..5350151 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java @@ -43,8 +43,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java index 4afab63..99cf162 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java @@ -47,8 +47,6 @@ 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) @@ -144,7 +142,7 @@ public interface RegionOperationApi { PagedIterable<Operation> listInRegion(@PathParam("region") String region); /** - * A paged version of RegionOperationApi#listFirstPageInRegion(String) + * A paged version of RegionOperationApi#listFirstPage(String) * * @return a Paged, Fluent Iterable that is able to fetch additional pages when required * @see org.jclouds.collect.PagedIterable http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java index e7b2b12..815ea8e 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java @@ -55,8 +55,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java index e0ac384..06616e8 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java @@ -48,8 +48,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java new file mode 100644 index 0000000..e5f282d --- /dev/null +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java @@ -0,0 +1,272 @@ +/* + * 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 org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; +import org.jclouds.Fallbacks.NullOnNotFoundOr404; +import org.jclouds.collect.IterableWithMarker; +import org.jclouds.collect.PagedIterable; +import org.jclouds.googlecomputeengine.domain.Operation; +import org.jclouds.googlecomputeengine.domain.TargetPool; +import org.jclouds.googlecomputeengine.functions.internal.ParseTargetPools; +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.OAuthAuthenticator; +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; + +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 java.net.URI; +import java.util.List; + +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; + +/** + * Provides access to TargetPools via their REST API. + */ +@SkipEncoding({'/', '='}) +@RequestFilters(OAuthAuthenticator.class) +@Consumes(MediaType.APPLICATION_JSON) +public interface TargetPoolApi { + + /** + * Returns the specified TargetPool resource. + * + * @param targetPool the name of the TargetPool resource to return. + * @return a TargetPool resource. + */ + @Named("TargetPools:get") + @GET + @Path("/targetPools/{targetPool}") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @Nullable + TargetPool get(@PathParam("targetPool") String targetPool); + + /** + * Creates a TargetPool resource in the specified project and region using the data included in the request. + * + * @param targetPoolName the name of the targetPool. + * @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("TargetPools:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/targetPools") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String targetPoolName); + + /** + * Creates a TargetPool resource in the specified project and region using the data included in the request. + * + * @param targetPoolName the name of the targetPool. + * @param instances A list of resource URLs to the member VMs serving this pool. They must live in zones + * contained in the same region as this pool. + * @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("TargetPools:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/targetPools") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String targetPoolName, @PayloadParam("instances") List<URI> instances); + + /** + * Creates a TargetPool resource in the specified project and region using the data included in the request. + * + * @param targetPoolName the name of the targetPool. + * @param instances A list of resource URLs to the member VMs serving this pool. They must live in zones + * contained in the same region as this pool. + * @param healthChecks A URL to one HttpHealthCheck resource. A member VM in this pool is considered healthy if + * and only if the specified health checks pass. An empty list means all member virtual + * machines will be considered healthy at all times but the health status of this target + * pool will be marked as unhealthy to indicate that no health checks are being performed. + * @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("TargetPools:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/targetPools") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String targetPoolName, @PayloadParam("instances") List<URI> instances, + @PayloadParam("healthChecks") List<URI> healthChecks); + + /** + * Creates a TargetPool resource in the specified project and region using the data included in the request. + * + * @param targetPoolName the name of the targetPool. + * @param instances A list of resource URLs to the member VMs serving this pool. They must live in zones + * contained in the same region as this pool. + * @param healthChecks A URL to one HttpHealthCheck resource. A member VM in this pool is considered healthy if + * and only if the specified health checks pass. An empty list means all member virtual + * machines will be considered healthy at all times but the health status of this target + * pool will be marked as unhealthy to indicate that no health checks are being performed. + * @param backupPool it is applicable only when the target pool is serving a forwarding rule as the primary pool. + * Must be a fully-qualified URL to a target pool that is in the same region as the primary + * target pool. + * @param sessionAffinity Defines the session affinity option. Session affinity determines the hash method that + * Google Compute Engine uses to distribute traffic. Acceptable values are: + * "CLIENT_IP": Connections from the same client IP are guaranteed to go to the same VM in the pool while that VM remains healthy. + * "CLIENT_IP_PROTO": Connections from the same client IP and port are guaranteed to go to the same VM in the pool while that VM remains healthy. + * "NONE": Connections from the same client IP may go to any VM in the pool. + * @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("TargetPools:insert") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/targetPools") + @OAuthScopes(COMPUTE_SCOPE) + @MapBinder(BindToJsonPayload.class) + Operation create(@PayloadParam("name") String targetPoolName, @PayloadParam("instances") List<URI> instances, + @PayloadParam("healthChecks") List<URI> healthChecks, @PayloadParam("backupPool") String backupPool, + @PayloadParam("sessionAffinity") String sessionAffinity); + + /** + * Deletes the specified TargetPool resource. + * + * @param targetPool name of the persistent target pool 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("TargetPools:delete") + @DELETE + @Path("/targetPools/{targetPool}") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @Nullable + Operation delete(@PathParam("targetPool") String targetPool); + + /** + * @return a Paged, Fluent Iterable that is able to fetch additional pages when required + * @see org.jclouds.collect.PagedIterable + */ + @Named("TargetPools:list") + @GET + @Path("/targetPools") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @ResponseParser(ParseTargetPools.class) + @Transform(ParseTargetPools.ToPagedIterable.class) + @Fallback(EmptyPagedIterableOnNotFoundOr404.class) + PagedIterable<TargetPool> list(); + + /** + * @param options @see org.jclouds.googlecomputeengine.options.ListOptions + * @return IterableWithMarker + */ + @Named("TargetPools:list") + @GET + @Path("/targetPools") + @OAuthScopes(COMPUTE_READONLY_SCOPE) + @ResponseParser(ParseTargetPools.class) + @Fallback(EmptyPagedIterableOnNotFoundOr404.class) + IterableWithMarker<TargetPool> list(ListOptions options); + + /** + * Adds instance to the targetPool. + * + * @param targetPool the name of the target pool. + * @param instanceName the name for the instance to be added to targetPool. + * + * @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("TargetPools:addInstance") + @POST + @Path("/targetPools/{targetPool}/addInstance") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @MapBinder(BindToJsonPayload.class) + @Nullable + Operation addInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instance") String instanceName); + + /** + * Adds health check URL to targetPool. + * + * @param targetPool the name of the target pool. + * @param healthCheck the name for the healthCheck to be added to targetPool. + * + * @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("TargetPools:addHealthCheck") + @POST + @Path("/targetPools/{targetPool}/addHealthCheck") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @MapBinder(BindToJsonPayload.class) + @Nullable + Operation addHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthCheck") String healthCheck); + + /** + * Removes instance URL from targetPool. + * + * @param targetPool the name of the target pool. + * @param instanceName the name for the instance to be removed from targetPool. + * + * @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("TargetPools:removeInstance") + @POST + @Path("/targetPools/{targetPool}/removeInstance") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @MapBinder(BindToJsonPayload.class) + @Nullable + Operation removeInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instanceName") String instanceName); + + /** + * Changes backup pool configurations. + * + * @param targetPool the name of the target pool. + * @param target the URL of target pool for which you want to use as backup. + * + * @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("TargetPools:setBackup") + @POST + @Path("/targetPools/{targetPool}/setBackup") + @OAuthScopes(COMPUTE_SCOPE) + @Fallback(NullOnNotFoundOr404.class) + @MapBinder(BindToJsonPayload.class) + @Nullable + Operation setBackup(@PathParam("targetPool") String targetPool, @PayloadParam("target") String target); +} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java index 26d10a6..32ef1ad 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java @@ -43,8 +43,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java index 3dd69e1..44ff057 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java @@ -47,8 +47,6 @@ 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) http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java index c6bc1ac..e6d4b11 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeeded.java @@ -74,27 +74,27 @@ public class CreateNetworkIfNeeded implements Function<NetworkAndAddressRange, N public Network apply(NetworkAndAddressRange input) { checkNotNull(input, "input"); - Network nw = api.getNetworkApiForProject(userProject.get()).get(input.getName()); + Network nw = api.getNetworkApi(userProject.get()).get(input.getName()); if (nw != null) { return nw; } if (input.getGateway().isPresent()) { - AtomicReference<Operation> operation = Atomics.newReference(api.getNetworkApiForProject(userProject + AtomicReference<Operation> operation = Atomics.newReference(api.getNetworkApi(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); + checkState(!operation.get().getHttpError().isPresent(), "Could not insert network, operation failed" + operation); } else { - AtomicReference<Operation> operation = Atomics.newReference(api.getNetworkApiForProject(userProject + AtomicReference<Operation> operation = Atomics.newReference(api.getNetworkApi(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); + checkState(!operation.get().getHttpError().isPresent(), "Could not insert network, operation failed" + operation); } - return checkNotNull(api.getNetworkApiForProject(userProject.get()).get(input.getName()), + return checkNotNull(api.getNetworkApi(userProject.get()).get(input.getName()), "no network with name %s was found", input.getName()); } } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java index 59b4408..f7a4d73 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java @@ -58,7 +58,7 @@ public class ParseAddresses extends ParseJson<ListPage<Address>> { @Override public IterableWithMarker<Address> apply(Object input) { - return api.getAddressApiForProject(projectName) + return api.getAddressApi(projectName) .listAtMarkerInRegion(regionName, input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java index eca4a11..2373838 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java @@ -58,7 +58,7 @@ public class ParseDisks extends ParseJson<ListPage<Disk>> { @Override public IterableWithMarker<Disk> apply(Object input) { - return api.getDiskApiForProject(projectName) + return api.getDiskApi(projectName) .listAtMarkerInZone(zoneName, input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java index 05d11bd..8cb7c5f 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java @@ -55,7 +55,7 @@ public class ParseFirewalls extends ParseJson<ListPage<Firewall>> { @Override public IterableWithMarker<Firewall> apply(Object input) { - return api.getFirewallApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getFirewallApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java new file mode 100644 index 0000000..f3d13dd --- /dev/null +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java @@ -0,0 +1,65 @@ +/* + * 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 com.google.common.base.Function; +import com.google.inject.TypeLiteral; +import org.jclouds.collect.IterableWithMarker; +import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; +import org.jclouds.googlecomputeengine.domain.ForwardingRule; +import org.jclouds.googlecomputeengine.domain.ListPage; +import org.jclouds.googlecomputeengine.options.ListOptions; +import org.jclouds.http.functions.ParseJson; +import org.jclouds.json.Json; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import static com.google.common.base.Preconditions.checkNotNull; + +@Singleton +public class ParseForwardingRules extends ParseJson<ListPage<ForwardingRule>> { + + @Inject + public ParseForwardingRules(Json json) { + super(json, new TypeLiteral<ListPage<ForwardingRule>>() { + }); + } + + public static class ToPagedIterable extends BaseWithRegionToPagedIterable<ForwardingRule, ToPagedIterable> { + + private final GoogleComputeEngineApi api; + + @Inject + protected ToPagedIterable(GoogleComputeEngineApi api) { + this.api = checkNotNull(api, "api"); + } + + @Override + protected Function<Object, IterableWithMarker<ForwardingRule>> fetchNextPage(final String projectName, + final String regionName, + final ListOptions options) { + return new Function<Object, IterableWithMarker<ForwardingRule>>() { + + @Override + public IterableWithMarker<ForwardingRule> apply(Object input) { + return api.getForwardingRuleApi(projectName, regionName).list(options); + } + }; + } + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java index b2a589e..3fdf230 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java @@ -55,7 +55,7 @@ public class ParseGlobalOperations extends ParseJson<ListPage<Operation>> { @Override public IterableWithMarker<Operation> apply(Object input) { - return api.getGlobalOperationApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getGlobalOperationApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java new file mode 100644 index 0000000..5ddc8d9 --- /dev/null +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java @@ -0,0 +1,64 @@ +/* + * 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 com.google.common.base.Function; +import com.google.inject.TypeLiteral; +import org.jclouds.collect.IterableWithMarker; +import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; +import org.jclouds.googlecomputeengine.domain.HttpHealthCheck; +import org.jclouds.googlecomputeengine.domain.ListPage; +import org.jclouds.googlecomputeengine.options.ListOptions; +import org.jclouds.http.functions.ParseJson; +import org.jclouds.json.Json; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import static com.google.common.base.Preconditions.checkNotNull; + +@Singleton +public class ParseHttpHealthChecks extends ParseJson<ListPage<HttpHealthCheck>> { + + @Inject + public ParseHttpHealthChecks(Json json) { + super(json, new TypeLiteral<ListPage<HttpHealthCheck>>() { + }); + } + + public static class ToPagedIterable extends BaseToPagedIterable<HttpHealthCheck, ToPagedIterable> { + + private final GoogleComputeEngineApi api; + + @Inject + protected ToPagedIterable(GoogleComputeEngineApi api) { + this.api = checkNotNull(api, "api"); + } + + @Override + protected Function<Object, IterableWithMarker<HttpHealthCheck>> fetchNextPage(final String projectName, + final ListOptions options) { + return new Function<Object, IterableWithMarker<HttpHealthCheck>>() { + + @Override + public IterableWithMarker<HttpHealthCheck> apply(Object input) { + return api.getHttpHealthCheckApi(projectName).list(options); + } + }; + } + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java index 6d23343..102d07b 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java @@ -55,7 +55,7 @@ public class ParseImages extends ParseJson<ListPage<Image>> { @Override public IterableWithMarker<Image> apply(Object input) { - return api.getImageApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getImageApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java index 001a98c..356ca45 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java @@ -56,7 +56,7 @@ public class ParseInstances extends ParseJson<ListPage<Instance>> { @Override public IterableWithMarker<Instance> apply(Object input) { - return api.getInstanceApiForProject(project) + return api.getInstanceApi(project) .listAtMarkerInZone(zone, input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java index be78b92..0e53257 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java @@ -55,7 +55,7 @@ public class ParseMachineTypes extends ParseJson<ListPage<MachineType>> { @Override public IterableWithMarker<MachineType> apply(Object input) { - return api.getMachineTypeApiForProject(project) + return api.getMachineTypeApi(project) .listAtMarkerInZone(zone, input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java index 0aa550b..62603aa 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java @@ -55,7 +55,7 @@ public class ParseNetworks extends ParseJson<ListPage<Network>> { @Override public IterableWithMarker<Network> apply(Object input) { - return api.getNetworkApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getNetworkApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java index 84c8954..d5fcbfb 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java @@ -56,7 +56,7 @@ public class ParseRegionOperations extends ParseJson<ListPage<Operation>> { @Override public IterableWithMarker<Operation> apply(Object input) { - return api.getRegionOperationApiForProject(projectName) + return api.getRegionOperationApi(projectName) .listAtMarkerInRegion(regionName, input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java index ca1819e..6680413 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java @@ -55,7 +55,7 @@ public class ParseRegions extends ParseJson<ListPage<Region>> { @Override public IterableWithMarker<Region> apply(Object input) { - return api.getRegionApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getRegionApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java index 6191892..8d40984 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java @@ -55,7 +55,7 @@ public class ParseRoutes extends ParseJson<ListPage<Route>> { @Override public IterableWithMarker<Route> apply(Object input) { - return api.getRouteApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getRouteApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java index 66ac2e7..c778ad5 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java @@ -57,7 +57,7 @@ public class ParseSnapshots extends ParseJson<ListPage<Snapshot>> { @Override public IterableWithMarker<Snapshot> apply(Object input) { - return api.getSnapshotApiForProject(projectName) + return api.getSnapshotApi(projectName) .listAtMarker(input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java new file mode 100644 index 0000000..2f19ca2 --- /dev/null +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java @@ -0,0 +1,66 @@ +/* + * 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 com.google.common.base.Function; +import com.google.inject.TypeLiteral; +import org.jclouds.collect.IterableWithMarker; +import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; +import org.jclouds.googlecomputeengine.domain.ListPage; +import org.jclouds.googlecomputeengine.domain.TargetPool; +import org.jclouds.googlecomputeengine.options.ListOptions; +import org.jclouds.http.functions.ParseJson; +import org.jclouds.json.Json; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import static com.google.common.base.Preconditions.checkNotNull; + +@Singleton +public class ParseTargetPools extends ParseJson<ListPage<TargetPool>> { + + @Inject + public ParseTargetPools(Json json) { + super(json, new TypeLiteral<ListPage<TargetPool>>() { + }); + } + + public static class ToPagedIterable extends BaseWithZoneToPagedIterable<TargetPool, ToPagedIterable> { + + private final GoogleComputeEngineApi api; + + @Inject + protected ToPagedIterable(GoogleComputeEngineApi api) { + this.api = checkNotNull(api, "api"); + } + + @Override + protected Function<Object, IterableWithMarker<TargetPool>> fetchNextPage(final String projectName, + final String regionName, + final ListOptions options) { + return new Function<Object, IterableWithMarker<TargetPool>>() { + + @Override + public IterableWithMarker<TargetPool> apply(Object input) { + return api.getTargetPoolApi(projectName, regionName) + .list(options); + } + }; + } + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZoneOperations.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZoneOperations.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZoneOperations.java index 28cc443..1d0adbd 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZoneOperations.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZoneOperations.java @@ -56,7 +56,7 @@ public class ParseZoneOperations extends ParseJson<ListPage<Operation>> { @Override public IterableWithMarker<Operation> apply(Object input) { - return api.getZoneOperationApiForProject(projectName) + return api.getZoneOperationApi(projectName) .listAtMarkerInZone(zoneName, input.toString(), options); } }; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZones.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZones.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZones.java index f3e54ea..0d474d6 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZones.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseZones.java @@ -55,7 +55,7 @@ public class ParseZones extends ParseJson<ListPage<Zone>> { @Override public IterableWithMarker<Zone> apply(Object input) { - return api.getZoneApiForProject(projectName).listAtMarker(input.toString(), options); + return api.getZoneApi(projectName).listAtMarker(input.toString(), options); } }; } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java index d70d4d0..300ce53 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java @@ -24,7 +24,7 @@ import org.jclouds.googlecomputeengine.domain.Firewall; import com.google.common.collect.ImmutableSet; /** - * Options to create a firewall. + * Options to insert a firewall. * * @see Firewall */ http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java index 9a3e88e..08b4367 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java @@ -22,8 +22,6 @@ import org.jclouds.http.options.BaseHttpRequestOptions; /** * Allows to optionally specify a filter, max results and a page token for <code>listFirstPage()</code> REST methods. - * - * @see <a href="https://developers.google.com/compute/docs/reference/v1/operations/listFirstPage"/> */ public class ListOptions extends BaseHttpRequestOptions { @@ -72,6 +70,14 @@ public class ListOptions extends BaseHttpRequestOptions { return this; } + /** + * Marks the beginning of the next list page + */ + public ListOptions marker(String marker) { + this.queryParameters.put("pageToken", checkNotNull(marker, "marker")); + return this; + } + public static class Builder { /** @@ -87,5 +93,12 @@ public class ListOptions extends BaseHttpRequestOptions { public ListOptions maxResults(Integer maxResults) { return new ListOptions().maxResults(maxResults); } + + /** + * @see ListOptions#marker(String) + */ + public ListOptions marker(String marker) { + return new ListOptions().marker(marker); + } } } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java index ec891ce..a6fa6ac 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java @@ -22,7 +22,7 @@ import java.util.Set; import com.google.common.collect.ImmutableSet; /** - * Options to create a route. + * Options to insert a route. * * @see org.jclouds.googlecomputeengine.domain.Route */ http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java index ac34bcc..f7be915 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/GlobalOperationDonePredicate.java @@ -45,7 +45,7 @@ public class GlobalOperationDonePredicate implements Predicate<AtomicReference<O @Override public boolean apply(AtomicReference<Operation> input) { checkNotNull(input, "input"); - Operation current = api.getGlobalOperationApiForProject(project.get()).get(input.get().getName()); + Operation current = api.getGlobalOperationApi(project.get()).get(input.get().getName()); switch (current.getStatus()) { case DONE: input.set(current); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java index 1f3dee6..54f0f3c 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/RegionOperationDonePredicate.java @@ -53,7 +53,7 @@ public class RegionOperationDonePredicate implements Predicate<AtomicReference<O public boolean apply(AtomicReference<Operation> input) { checkNotNull(input, "input"); - Operation current = api.getRegionOperationApiForProject(project.get()) + Operation current = api.getRegionOperationApi(project.get()) .getInRegion(regions.get().get(input.get().getRegion().get()).getName(), input.get().getName()); switch (current.getStatus()) { http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java index c63c6f3..c681ae7 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/ZoneOperationDonePredicate.java @@ -52,7 +52,7 @@ public class ZoneOperationDonePredicate implements Predicate<AtomicReference<Ope @Override public boolean apply(AtomicReference<Operation> input) { checkNotNull(input, "input"); - Operation current = api.getZoneOperationApiForProject(project.get()) + Operation current = api.getZoneOperationApi(project.get()) .getInZone(zones.get().get(input.get().getZone().get()).getId(), input.get().getName()); switch (current.getStatus()) { http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java index 8fa44b9..e437ffe 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java @@ -49,7 +49,7 @@ public class PageSystemExpectTest extends BaseGoogleComputeEngineApiExpectTest { .payload(payloadFromResource("/image_list_single_page.json")).build(); ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list, operationResponse).getImageApiForProject("myproject"); + TOKEN_RESPONSE, list, operationResponse).getImageApi("myproject"); PagedIterable<Image> images = imageApi.list(); @@ -98,7 +98,7 @@ public class PageSystemExpectTest extends BaseGoogleComputeEngineApiExpectTest { ImageApi imageApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), TOKEN_RESPONSE, list1, list1response, list2, list2Response, list3, list3Response) - .getImageApiForProject("myproject"); + .getImageApi("myproject"); PagedIterable<Image> images = imageApi.list(new ListOptions.Builder().maxResults(3)); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java index 2011d2d..8cb05f2 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java @@ -65,7 +65,7 @@ public class GoogleComputeEngineServiceLiveTest extends BaseComputeServiceLiveTe Supplier<String> userProject = context.utils().injector().getInstance(Key.get(new TypeLiteral<Supplier<String>>() { }, UserProject.class)); ImmutableSet.Builder<String> deprecatedMachineTypes = ImmutableSet.builder(); - for (MachineType machine : api.getMachineTypeApiForProject(userProject.get()) + for (MachineType machine : api.getMachineTypeApi(userProject.get()) .listInZone(DEFAULT_ZONE_NAME).concat()) { if (machine.getDeprecated().isPresent()) { deprecatedMachineTypes.add(machine.getId()); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java index 795c989..3662fe9 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java @@ -60,7 +60,7 @@ public class NetworkToSecurityGroupTest { FirewallApi fwApi = createMock(FirewallApi.class); ListOptions options = new Builder().filter("network eq .*/jclouds-test"); - expect(api.getFirewallApiForProject(projectSupplier.get())) + expect(api.getFirewallApi(projectSupplier.get())) .andReturn(fwApi); expect(fwApi.list(options)).andReturn(PagedIterables.of(IterableWithMarkers.from(ImmutableSet.of(FirewallToIpPermissionTest.fwForTest())))); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/ed9fc5c5/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java index 467995f..655f763 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java @@ -59,7 +59,7 @@ public class FindNetworkOrCreateTest { } }; - expect(api.getNetworkApiForProject(userProject.get())).andReturn(nwApi).atLeastOnce(); + expect(api.getNetworkApi(userProject.get())).andReturn(nwApi).atLeastOnce(); expect(nwApi.get("this-network")).andReturn(network); @@ -103,18 +103,18 @@ public class FindNetworkOrCreateTest { } }; - expect(api.getNetworkApiForProject(userProject.get())).andReturn(nwApi).atLeastOnce(); - expect(api.getGlobalOperationApiForProject(userProject.get())).andReturn(globalApi).atLeastOnce(); + expect(api.getNetworkApi(userProject.get())).andReturn(nwApi).atLeastOnce(); + expect(api.getGlobalOperationApi(userProject.get())).andReturn(globalApi).atLeastOnce(); expect(nwApi.createInIPv4Range("this-network", "0.0.0.0/0")) .andReturn(createOp); - expect(globalApi.get("create-op")).andReturn(createOp); + expect(globalApi.get("insert-op")).andReturn(createOp); // pre-creation expect(nwApi.get("this-network")).andReturn(null).times(2); // post-creation expect(nwApi.get("this-network")).andReturn(network); - expect(createOp.getName()).andReturn("create-op"); + expect(createOp.getName()).andReturn("insert-op"); expect(createOp.getStatus()).andReturn(Operation.Status.DONE); expect(createOp.getHttpError()).andReturn(fromNullable((HttpResponse)null)); replay(api, nwApi, createOp, globalApi);
