http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java index b688ae4..a0a00be 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java @@ -17,7 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import java.util.Iterator; @@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.ListPage; import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage; 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; @@ -49,7 +47,6 @@ import com.google.common.base.Function; @RequestFilters(OAuthAuthenticationFilter.class) @Path("/diskTypes") @Consumes(APPLICATION_JSON) -@OAuthScopes(COMPUTE_READONLY_SCOPE) public interface DiskTypeApi { /** Returns a disk type by name or null if not found. */
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 673ec3f..9c25376 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.net.URI; import java.util.Iterator; @@ -46,7 +44,6 @@ import org.jclouds.googlecomputeengine.internal.PATCH; import org.jclouds.googlecomputeengine.options.FirewallOptions; 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.BinderParam; import org.jclouds.rest.annotations.Fallback; @@ -69,7 +66,6 @@ public interface FirewallApi { @Named("Firewalls:get") @GET @Path("/{firewall}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Firewall get(@PathParam("firewall") String firewall); @@ -86,7 +82,6 @@ public interface FirewallApi { @Named("Firewalls:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(FirewallBinder.class) Operation createInNetwork(@PayloadParam("name") String name, @PayloadParam("network") URI network, @@ -104,7 +99,6 @@ public interface FirewallApi { @PUT @Produces(APPLICATION_JSON) @Path("/{firewall}") - @OAuthScopes(COMPUTE_SCOPE) Operation update(@PathParam("firewall") String firewall, @BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions); @@ -120,7 +114,6 @@ public interface FirewallApi { @PATCH @Produces(APPLICATION_JSON) @Path("/{firewall}") - @OAuthScopes(COMPUTE_SCOPE) Operation patch(@PathParam("firewall") String firewall, @BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions); @@ -128,7 +121,6 @@ public interface FirewallApi { @Named("Firewalls:delete") @DELETE @Path("/{firewall}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) Operation delete(@PathParam("firewall") String firewall); @@ -143,20 +135,17 @@ public interface FirewallApi { */ @Named("Firewalls:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Firewall> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("Firewalls:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(FirewallPages.class) Iterator<ListPage<Firewall>> list(); /** @see #listPage(String, ListOptions) */ @Named("Firewalls:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(FirewallPages.class) Iterator<ListPage<Firewall>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 index 1991226..90a591b 100644 --- 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.net.URI; import java.util.Iterator; @@ -44,7 +42,6 @@ import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPa import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions; 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; @@ -66,7 +63,6 @@ public interface ForwardingRuleApi { @Named("ForwardingRules:get") @GET @Path("/{forwardingRule}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable ForwardingRule get(@PathParam("forwardingRule") String forwardingRule); @@ -81,7 +77,6 @@ public interface ForwardingRuleApi { @Named("ForwardingRules:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(ForwardingRuleCreationBinder.class) Operation create(@PayloadParam("name") String forwardingRuleName, @PayloadParam("options") ForwardingRuleCreationOptions options); @@ -91,7 +86,6 @@ public interface ForwardingRuleApi { @Named("ForwardingRules:delete") @DELETE @Path("/{forwardingRule}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("forwardingRule") String forwardingRule); @@ -109,7 +103,6 @@ public interface ForwardingRuleApi { @Named("ForwardingRules:setTarget") @POST @Path("/{forwardingRule}/setTarget") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @MapBinder(BindToJsonPayload.class) @Nullable @@ -126,20 +119,17 @@ public interface ForwardingRuleApi { */ @Named("ForwardingRules:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<ForwardingRule> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("ForwardingRules:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(ForwardingRulePages.class) Iterator<ListPage<ForwardingRule>> list(); /** @see #listPage(String, ListOptions) */ @Named("ForwardingRules:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(ForwardingRulePages.class) Iterator<ListPage<ForwardingRule>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 index 1dc88c5..767f6a3 100644 --- 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.util.Iterator; @@ -44,7 +42,6 @@ import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions; 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; @@ -67,7 +64,6 @@ public interface HttpHealthCheckApi { @Named("HttpHealthChecks:get") @GET @Path("/{httpHealthCheck}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable HttpHealthCheck get(@PathParam("httpHealthCheck") String httpHealthCheck); @@ -82,7 +78,6 @@ public interface HttpHealthCheckApi { @Named("HttpHealthChecks:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(BindToJsonPayload.class) Operation insert(@PayloadParam("name") String httpHealthCheckName); @@ -96,7 +91,6 @@ public interface HttpHealthCheckApi { @Named("HttpHealthChecks:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(HttpHealthCheckCreationBinder.class) Operation insert(@PayloadParam("name") String name, @PayloadParam("options") HttpHealthCheckCreationOptions options); @@ -104,7 +98,6 @@ public interface HttpHealthCheckApi { @Named("HttpHealthChecks:delete") @DELETE @Path("/{httpHealthCheck}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("httpHealthCheck") String httpHealthCheck); @@ -121,7 +114,6 @@ public interface HttpHealthCheckApi { @Named("HttpHealthChecks:patch") @PATCH @Path("/{httpHealthCheck}") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(HttpHealthCheckCreationBinder.class) @Nullable Operation patch(@PathParam("httpHealthCheck") @PayloadParam("name") String name, @@ -140,7 +132,6 @@ public interface HttpHealthCheckApi { @PUT @Path("/{httpHealthCheck}") @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(HttpHealthCheckCreationBinder.class) Operation update(@PathParam("httpHealthCheck") @PayloadParam("name") String name, @PayloadParam("options") HttpHealthCheckCreationOptions options); @@ -156,20 +147,17 @@ public interface HttpHealthCheckApi { */ @Named("HttpHealthChecks:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<HttpHealthCheck> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("HttpHealthChecks:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(HttpHealthCheckPages.class) Iterator<ListPage<HttpHealthCheck>> list(); /** @see #listPage(String, ListOptions) */ @Named("HttpHealthChecks:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(HttpHealthCheckPages.class) Iterator<ListPage<HttpHealthCheck>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 996f9fc..e4faa6f 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.net.URI; import java.util.Iterator; @@ -44,7 +42,6 @@ import org.jclouds.googlecomputeengine.internal.BaseArg0ToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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.Endpoint; import org.jclouds.rest.annotations.EndpointParam; @@ -66,7 +63,6 @@ public interface ImageApi { /** Returns an image by self-link or null if not found. */ @Named("Images:get") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Image get(@EndpointParam URI selfLink); @@ -76,7 +72,6 @@ public interface ImageApi { @GET @Endpoint(CurrentProject.class) @Path("/global/images/{image}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Image get(@PathParam("image") String image); @@ -86,7 +81,6 @@ public interface ImageApi { @DELETE @Endpoint(CurrentProject.class) @Path("/global/images/{image}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("image") String image); @@ -104,7 +98,6 @@ public interface ImageApi { @Endpoint(CurrentProject.class) @Path("/global/images") @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(BindToJsonPayload.class) Operation createFromDisk(@PayloadParam("name") String image, @PayloadParam("sourceDisk") String sourceDisk); @@ -121,7 +114,6 @@ public interface ImageApi { @GET @Endpoint(CurrentProject.class) @Path("/global/images") - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Image> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @@ -129,7 +121,6 @@ public interface ImageApi { @GET @Endpoint(CurrentProject.class) @Path("/global/images") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(ImagePages.class) Iterator<ListPage<Image>> list(); @@ -138,7 +129,6 @@ public interface ImageApi { @GET @Endpoint(CurrentProject.class) @Path("/global/images") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(ImagePages.class) Iterator<ListPage<Image>> list(ListOptions options); @@ -171,7 +161,6 @@ public interface ImageApi { @Named("Images:list") @GET @Path("/projects/{project}/global/images") - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Image> listPageInProject(@PathParam("project") String projectName, @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); @@ -181,7 +170,6 @@ public interface ImageApi { @Named("Images:list") @GET @Path("/projects/{project}/global/images") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(ImagePagesInProject.class) Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName); @@ -191,7 +179,6 @@ public interface ImageApi { @Named("Images:list") @GET @Path("/projects/{project}/global/images") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(ImagePagesInProject.class) Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName, ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 9e6dfd2..05bc23a 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig; import static org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput; @@ -46,7 +44,6 @@ import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPa import org.jclouds.googlecomputeengine.options.AttachDiskOptions; 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.BinderParam; import org.jclouds.rest.annotations.Fallback; @@ -69,7 +66,6 @@ public interface InstanceApi { @Named("Instances:get") @GET @Path("/{instance}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Instance get(@PathParam("instance") String instance); @@ -84,14 +80,12 @@ public interface InstanceApi { @Named("Instances:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) Operation create(@BinderParam(BindToJsonPayload.class) NewInstance template); /** Deletes an instance by name and returns the operation in progress, or null if not found. */ @Named("Instances:delete") @DELETE @Path("/{instance}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("instance") String instance); @@ -109,7 +103,6 @@ public interface InstanceApi { @POST @Produces(APPLICATION_JSON) @Path("/{instance}/addAccessConfig") - @OAuthScopes(COMPUTE_SCOPE) Operation addAccessConfigToNic(@PathParam("instance") String instance, @BinderParam(BindToJsonPayload.class) AccessConfig accessConfig, @@ -127,7 +120,6 @@ public interface InstanceApi { @Named("Instances:deleteAccessConfig") @DELETE @Path("/{instance}/deleteAccessConfig") - @OAuthScopes(COMPUTE_SCOPE) Operation deleteAccessConfigFromNic(@PathParam("instance") String instance, @QueryParam("access_config") String accessConfigName, @QueryParam("network_interface") String networkInterfaceName); @@ -141,7 +133,6 @@ public interface InstanceApi { @Named("Instances:serialPort") @GET @Path("/{instance}/serialPort") - @OAuthScopes(COMPUTE_READONLY_SCOPE) SerialPortOutput getSerialPortOutput(@PathParam("instance") String instance); /** @@ -154,7 +145,6 @@ public interface InstanceApi { @Named("Instances:reset") @POST @Path("/{instance}/reset") - @OAuthScopes(COMPUTE_SCOPE) Operation reset(@PathParam("instance") String instance); /** @@ -170,7 +160,6 @@ public interface InstanceApi { @POST @Produces(APPLICATION_JSON) @Path("/{instance}/attachDisk") - @OAuthScopes(COMPUTE_SCOPE) Operation attachDisk(@PathParam("instance") String instance, @BinderParam(BindToJsonPayload.class) AttachDiskOptions attachDiskOptions); @@ -186,7 +175,6 @@ public interface InstanceApi { @Named("Instances:detachDisk") @POST @Path("/{instance}/detachDisk") - @OAuthScopes(COMPUTE_SCOPE) Operation detachDisk(@PathParam("instance") String instance, @QueryParam("deviceName") String deviceName); /** @@ -209,8 +197,6 @@ public interface InstanceApi { @Named("Instances:setMetadata") @POST @Path("/{instance}/setMetadata") - @OAuthScopes(COMPUTE_SCOPE) - @Produces(APPLICATION_JSON) Operation setMetadata(@PathParam("instance") String instance, @BinderParam(BindToJsonPayload.class) Metadata metadata); @@ -226,7 +212,6 @@ public interface InstanceApi { @Named("Instances:setTags") @POST @Path("/{instance}/setTags") - @OAuthScopes(COMPUTE_SCOPE) @Produces(APPLICATION_JSON) @MapBinder(BindToJsonPayload.class) Operation setTags(@PathParam("instance") String instance, @@ -244,20 +229,17 @@ public interface InstanceApi { */ @Named("Instances:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Instance> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("Instances:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(InstancePages.class) Iterator<ListPage<Instance>> list(); /** @see #listPage(String, ListOptions) */ @Named("Instances:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(InstancePages.class) Iterator<ListPage<Instance>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 f2330b2..543c15f 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 @@ -17,7 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import java.util.Iterator; @@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.MachineType; import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage; 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; @@ -55,7 +53,6 @@ public interface MachineTypeApi { @Named("MachineTypes:get") @GET @Path("/{machineType}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) MachineType get(@PathParam("machineType") String machineType); @@ -70,20 +67,17 @@ public interface MachineTypeApi { */ @Named("MachineTypes:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<MachineType> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("MachineTypes:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(MachineTypePages.class) Iterator<ListPage<MachineType>> list(); /** @see #listPage(String, ListOptions) */ @Named("MachineTypes:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(MachineTypePages.class) Iterator<ListPage<MachineType>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 85a96bf..7ef7e0e 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.util.Iterator; @@ -41,7 +39,6 @@ import org.jclouds.googlecomputeengine.domain.Operation; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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; @@ -63,7 +60,6 @@ public interface NetworkApi { @Named("Networks:get") @GET @Path("/{network}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) Network get(@PathParam("network") String networkName); @@ -78,7 +74,6 @@ public interface NetworkApi { @Named("Networks:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(BindToJsonPayload.class) Operation createInIPv4Range(@PayloadParam("name") String networkName, @PayloadParam("IPv4Range") String IPv4Range); @@ -95,7 +90,6 @@ public interface NetworkApi { @Named("Networks:insert") @POST @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(BindToJsonPayload.class) Operation createInIPv4RangeWithGateway(@PayloadParam("name") String networkName, @PayloadParam("IPv4Range") String IPv4Range, @@ -105,7 +99,6 @@ public interface NetworkApi { @Named("Networks:delete") @DELETE @Path("/{network}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) Operation delete(@PathParam("network") String networkName); @@ -120,20 +113,17 @@ public interface NetworkApi { */ @Named("Networks:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Network> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("Networks:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(NetworkPages.class) Iterator<ListPage<Network>> list(); /** @see #listPage(String, ListOptions) */ @Named("Networks:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(NetworkPages.class) Iterator<ListPage<Network>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java index 734bd06..938fd85 100644 --- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java +++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java @@ -18,8 +18,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static org.jclouds.Fallbacks.VoidOnNotFoundOr404; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.net.URI; import java.util.Iterator; @@ -42,7 +40,6 @@ import org.jclouds.googlecomputeengine.internal.BaseArg0ToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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.Endpoint; import org.jclouds.rest.annotations.EndpointParam; @@ -61,7 +58,6 @@ public interface OperationApi { /** Returns an operation by self-link or null if not found. */ @Named("Operations:get") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation get(@EndpointParam URI operation); @@ -69,7 +65,6 @@ public interface OperationApi { /** Deletes an operation by name. */ @Named("Operations:delete") @DELETE - @OAuthScopes(COMPUTE_SCOPE) @Fallback(VoidOnNotFoundOr404.class) void delete(@EndpointParam URI operation); @@ -86,7 +81,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/global/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Operation> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @@ -94,7 +88,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/global/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(OperationPages.class) Iterator<ListPage<Operation>> list(); @@ -103,7 +96,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/global/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(OperationPages.class) Iterator<ListPage<Operation>> list(ListOptions options); @@ -137,7 +129,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Operation> listPageInRegion(@PathParam("region") String region, @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); @@ -146,7 +137,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(OperationPagesInRegion.class) Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region); @@ -155,7 +145,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/regions/{region}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(OperationPagesInRegion.class) Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region, ListOptions options); @@ -191,7 +180,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Operation> listPageInZone(@PathParam("zone") String zone, @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); @@ -200,7 +188,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(OperationPagesInZone.class) Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone); @@ -209,7 +196,6 @@ public interface OperationApi { @GET @Endpoint(CurrentProject.class) @Path("/zones/{zone}/operations") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(OperationPagesInZone.class) Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone, ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 b6242c6..86cca47 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import javax.inject.Named; import javax.ws.rs.Consumes; @@ -31,7 +29,6 @@ import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.NullOn400or4 import org.jclouds.googlecomputeengine.domain.Metadata; import org.jclouds.googlecomputeengine.domain.Operation; import org.jclouds.googlecomputeengine.domain.Project; -import org.jclouds.oauth.v2.config.OAuthScopes; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.Fallback; @@ -47,7 +44,6 @@ public interface ProjectApi { /** Get the current project. */ @Named("Projects:get") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOn400or404.class) Project get(); @@ -69,7 +65,6 @@ public interface ProjectApi { @Named("Projects:setCommonInstanceMetadata") @POST @Path("/setCommonInstanceMetadata") - @OAuthScopes(COMPUTE_SCOPE) @Produces(APPLICATION_JSON) Operation setCommonInstanceMetadata(@BinderParam(BindToJsonPayload.class) Metadata metadata); } http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 debf050..658ec86 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 @@ -17,7 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import java.util.Iterator; @@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.Region; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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; @@ -49,7 +47,6 @@ import com.google.common.base.Function; @RequestFilters(OAuthAuthenticationFilter.class) @Path("/regions") @Consumes(APPLICATION_JSON) -@OAuthScopes(COMPUTE_READONLY_SCOPE) public interface RegionApi { /** Returns a region by name or null if not found. */ http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 d1f1938..aedbc1b 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.net.URI; import java.util.Iterator; @@ -44,7 +42,6 @@ import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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; @@ -65,16 +62,13 @@ public interface RouteApi { @Named("Routes:get") @GET @Path("/{route}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) Route get(@PathParam("route") String routeName); /** Deletes a route by name and returns the operation in progress, or null if not found. */ @Named("Routes:delete") @DELETE - @Consumes(APPLICATION_JSON) @Path("/{route}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("route") String routeName); @@ -90,9 +84,7 @@ public interface RouteApi { */ @Named("Routes:insert") @POST - @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(RouteBinder.class) Operation createInNetwork(@PayloadParam("name") String name, @PayloadParam("network") URI network, @@ -109,20 +101,17 @@ public interface RouteApi { */ @Named("Routes:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Route> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("Routes:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(RoutePages.class) Iterator<ListPage<Route>> list(); /** @see #listPage(String, ListOptions) */ @Named("Routes:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(RoutePages.class) Iterator<ListPage<Route>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 4b65417..9af65a6 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.util.Iterator; @@ -39,7 +37,6 @@ import org.jclouds.googlecomputeengine.domain.Snapshot; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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; @@ -58,7 +55,6 @@ public interface SnapshotApi { @Named("Snapshots:get") @GET @Path("/{snapshot}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Snapshot get(@PathParam("snapshot") String snapshot); @@ -67,7 +63,6 @@ public interface SnapshotApi { @Named("Snapshots:delete") @DELETE @Path("/{snapshot}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("snapshot") String snapshot); @@ -83,20 +78,17 @@ public interface SnapshotApi { */ @Named("Snapshots:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<Snapshot> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("Snapshots:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(SnapshotPages.class) Iterator<ListPage<Snapshot>> list(); /** @see #listPage(String, ListOptions) */ @Named("Snapshots:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(SnapshotPages.class) Iterator<ListPage<Snapshot>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 index ff15fab..534d769 100644 --- 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 @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import java.net.URI; import java.util.Iterator; @@ -47,7 +45,6 @@ import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPa import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions; 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; @@ -69,7 +66,6 @@ public interface TargetPoolApi { @Named("TargetPools:get") @GET @Path("/{targetPool}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable TargetPool get(@PathParam("targetPool") String targetPool); @@ -85,8 +81,6 @@ public interface TargetPoolApi { @Named("TargetPools:insert") @POST @Produces(APPLICATION_JSON) - @Path("") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(TargetPoolCreationBinder.class) Operation create(@PayloadParam("name") String name, @PayloadParam("options") TargetPoolCreationOptions options); @@ -94,7 +88,6 @@ public interface TargetPoolApi { @Named("TargetPools:delete") @DELETE @Path("/{targetPool}") - @OAuthScopes(COMPUTE_SCOPE) @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@PathParam("targetPool") String targetPool); @@ -111,7 +104,6 @@ public interface TargetPoolApi { @Named("TargetPools:addInstance") @POST @Path("/{targetPool}/addInstance") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(TargetPoolChangeInstancesBinder.class) @Nullable Operation addInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances); @@ -128,7 +120,6 @@ public interface TargetPoolApi { @Named("TargetPools:removeInstance") @POST @Path("/{targetPool}/removeInstance") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(TargetPoolChangeInstancesBinder.class) @Nullable Operation removeInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances); @@ -145,7 +136,6 @@ public interface TargetPoolApi { @Named("TargetPools:addHealthCheck") @POST @Path("/{targetPool}/addHealthCheck") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(TargetPoolChangeHealthChecksBinder.class) @Nullable Operation addHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks); @@ -163,7 +153,6 @@ public interface TargetPoolApi { @Named("TargetPools:removeHealthChek") @POST @Path("/{targetPool}/removeHealthCheck") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(TargetPoolChangeHealthChecksBinder.class) @Nullable Operation removeHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks); @@ -184,7 +173,6 @@ public interface TargetPoolApi { @Named("TargetPools:setBackup") @POST @Path("/{targetPool}/setBackup") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(BindToJsonPayload.class) @Nullable Operation setBackup(@PathParam("targetPool") String targetPool, @PayloadParam("target") URI target); @@ -201,7 +189,6 @@ public interface TargetPoolApi { @Named("TargetPools:setBackup") @POST @Path("/{targetPool}/setBackup") - @OAuthScopes(COMPUTE_SCOPE) @MapBinder(BindToJsonPayload.class) @Nullable Operation setBackup(@PathParam("targetPool") String targetPool, @QueryParam("failoverRatio") Float failoverRatio, @PayloadParam("target") URI target); @@ -217,20 +204,17 @@ public interface TargetPoolApi { */ @Named("TargetPools:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) ListPage<TargetPool> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); /** @see #listPage(String, ListOptions) */ @Named("TargetPools:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(TargetPoolPages.class) Iterator<ListPage<TargetPool>> list(); /** @see #listPage(String, ListOptions) */ @Named("TargetPools:list") @GET - @OAuthScopes(COMPUTE_READONLY_SCOPE) @Transform(TargetPoolPages.class) Iterator<ListPage<TargetPool>> list(ListOptions options); http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/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 359518f..e06efa6 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 @@ -17,7 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import java.util.Iterator; @@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.Zone; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; 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; @@ -49,7 +47,6 @@ import com.google.common.base.Function; @RequestFilters(OAuthAuthenticationFilter.class) @Path("/zones") @Consumes(APPLICATION_JSON) -@OAuthScopes(COMPUTE_READONLY_SCOPE) public interface ZoneApi { /** Returns a zone by name or null if not found. */ http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineAuthenticatedRestContextLiveTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineAuthenticatedRestContextLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineAuthenticatedRestContextLiveTest.java index 0d48e13..b6ceeee 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineAuthenticatedRestContextLiveTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineAuthenticatedRestContextLiveTest.java @@ -18,7 +18,6 @@ package org.jclouds.googlecomputeengine; import java.util.Properties; -import org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes; import org.jclouds.googlecomputeengine.internal.TestProperties; import org.jclouds.oauth.v2.internal.BaseOAuthAuthenticatedApiLiveTest; import org.testng.annotations.Test; @@ -32,7 +31,7 @@ public class GoogleComputeEngineAuthenticatedRestContextLiveTest extends BaseOAu @Override public String getScopes() { - return GoogleComputeEngineScopes.COMPUTE_SCOPE; + return "https://www.googleapis.com/auth/compute"; } @Override protected Properties setupProperties() { http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java index c29bfb1..5feeef1 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java index b7d4545..6fd7840 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiExpectTest.java index d312ee4..37ece62 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiExpectTest.java @@ -16,7 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java index f7f2b16..96dd7b2 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java @@ -19,8 +19,6 @@ package org.jclouds.googlecomputeengine.features; import static com.google.common.base.Joiner.on; import static com.google.common.collect.Iterables.transform; import static java.lang.String.format; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.jclouds.io.Payloads.newStringPayload; import static org.jclouds.util.Strings2.toStringAndClose; import static org.testng.Assert.assertEquals; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiExpectTest.java index 64fd2c8..d3c5402 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java index 68f7c2b..494230d 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java index cb2a48b..cb74767 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java index b80eed6..ce353e3 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.jclouds.googlecomputeengine.features.ProjectApiExpectTest.GET_PROJECT_REQUEST; import static org.jclouds.googlecomputeengine.features.ProjectApiExpectTest.GET_PROJECT_RESPONSE; import static org.testng.Assert.assertEquals; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java index 7831a69..01be4c3 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java @@ -16,7 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java index 38fd8e9..a4996bc 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiExpectTest.java index d220904..5d3474e 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java index 0fd86e2..fd945e8 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java @@ -17,8 +17,6 @@ package org.jclouds.googlecomputeengine.features; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java index 1115afb..86273da 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java @@ -16,7 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java index 4bb5dbe..abeeb5f 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java index ed5f13d..2465809 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java @@ -16,7 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiExpectTest.java index 7a4bbbc..08424fd 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiExpectTest.java @@ -16,8 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java index f6521a8..43f1b00 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java @@ -16,7 +16,6 @@ */ package org.jclouds.googlecomputeengine.features; -import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNull; http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/internal/ToIteratorOfListPageExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/internal/ToIteratorOfListPageExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/internal/ToIteratorOfListPageExpectTest.java deleted file mode 100644 index f3f9eb5..0000000 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/internal/ToIteratorOfListPageExpectTest.java +++ /dev/null @@ -1,185 +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 org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE; -import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults; -import static org.testng.Assert.assertEquals; - -import java.util.Iterator; -import java.util.List; - -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.config.GoogleComputeEngineParserModule; -import org.jclouds.googlecomputeengine.domain.Address; -import org.jclouds.googlecomputeengine.domain.Image; -import org.jclouds.googlecomputeengine.domain.Instance; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.features.AddressApi; -import org.jclouds.googlecomputeengine.features.ImageApi; -import org.jclouds.googlecomputeengine.features.InstanceApi; -import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest; -import org.jclouds.googlecomputeengine.parse.ParseAddressTest; -import org.jclouds.googlecomputeengine.parse.ParseImageTest; -import org.jclouds.googlecomputeengine.parse.ParseInstanceTest; -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.json.Json; -import org.jclouds.json.config.GsonModule; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Guice; - -@Test(groups = "unit", testName = "ToIteratorOfListPageTest") -public class ToIteratorOfListPageExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> { - - private final Json json = Guice.createInjector(new GsonModule(), new GoogleComputeEngineParserModule()) - .getInstance(Json.class); - - public void globalScope() { - HttpRequest list = HttpRequest - .builder() - .method("GET") - .endpoint(BASE_URL + "/party/global/images") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpResponse operationResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResource("/image_list_single_page.json")).build(); - - ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list, operationResponse).images(); - - Iterator<ListPage<Image>> images = imageApi.list(); - - assertEquals(images.next().size(), 3); - } - - public void multiplePagesProjectScoped() { - HttpRequest list1 = HttpRequest - .builder() - .method("GET") - .endpoint(BASE_URL + "/party/global/images?maxResults=1") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpRequest list2 = list1.toBuilder() - .endpoint(BASE_URL + "/party/global/images?pageToken=token1&maxResults=1").build(); - - HttpRequest list3 = list1.toBuilder() - .endpoint(BASE_URL + "/party/global/images?pageToken=token2&maxResults=1").build(); - - List<Image> items = ImmutableList.of(new ParseImageTest().expected()); - - HttpResponse list1Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, "token1"))).build(); - - HttpResponse list2Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, "token2"))).build(); - - HttpResponse list3Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, null))).build(); - - ImageApi imageApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list1, list1Response, list2, list2Response, list3, list3Response).images(); - - Iterator<ListPage<Image>> images = imageApi.list(maxResults(1)); - - int imageCounter = 0; - while (images.hasNext()) { - imageCounter += images.next().size(); - } - assertEquals(imageCounter, 3); - } - - public void multiplePagesRegionScoped() { - HttpRequest list1 = HttpRequest - .builder() - .method("GET") - .endpoint(BASE_URL + "/party/regions/us-central1/addresses?maxResults=1") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpRequest list2 = list1.toBuilder() - .endpoint(BASE_URL + "/party/regions/us-central1/addresses?pageToken=token1&maxResults=1").build(); - - HttpRequest list3 = list1.toBuilder() - .endpoint(BASE_URL + "/party/regions/us-central1/addresses?pageToken=token2&maxResults=1").build(); - - List<Address> items = ImmutableList.of(new ParseAddressTest().expected()); - - HttpResponse list1Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, "token1"))).build(); - - HttpResponse list2Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, "token2"))).build(); - - HttpResponse list3Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, null))).build(); - - AddressApi addressApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list1, list1Response, list2, list2Response, list3, list3Response) - .addressesInRegion("us-central1"); - - Iterator<ListPage<Address>> addresses = addressApi.list(maxResults(1)); - - int addressCounter = 0; - while (addresses.hasNext()) { - addressCounter += addresses.next().size(); - } - assertEquals(addressCounter, 3); - } - - public void multiplePagesZoneScoped() { - HttpRequest list1 = HttpRequest - .builder() - .method("GET") - .endpoint(BASE_URL + "/party/zones/us-central1-a/instances?maxResults=1") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpRequest list2 = list1.toBuilder() - .endpoint(BASE_URL + "/party/zones/us-central1-a/instances?pageToken=token1&maxResults=1").build(); - - HttpRequest list3 = list1.toBuilder() - .endpoint(BASE_URL + "/party/zones/us-central1-a/instances?pageToken=token2&maxResults=1").build(); - - List<Instance> items = ImmutableList.of(new ParseInstanceTest().expected()); - - HttpResponse list1Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, "token1"))).build(); - - HttpResponse list2Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, "token2"))).build(); - - HttpResponse list3Response = HttpResponse.builder().statusCode(200) - .payload(json.toJson(ListPage.create(items, null))).build(); - - InstanceApi instanceApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list1, list1Response, list2, list2Response, list3, list3Response) - .instancesInZone("us-central1-a"); - - Iterator<ListPage<Instance>> instances = instanceApi.list(maxResults(1)); - - int instanceCounter = 0; - while (instances.hasNext()) { - instanceCounter += instances.next().size(); - } - assertEquals(instanceCounter, 3); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/62766701/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java ---------------------------------------------------------------------- diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java index 220f5f0..3deb22a 100644 --- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java +++ b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java @@ -40,6 +40,8 @@ import com.google.common.base.Joiner; import com.google.inject.Module; public class BaseGoogleComputeEngineExpectTest<T> extends BaseRestApiExpectTest<T> { + protected static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute"; + protected static final String COMPUTE_READONLY_SCOPE = "https://www.googleapis.com/auth/compute.readonly"; protected static final String BASE_URL = "https://www.googleapis.com/compute/v1/projects"; private static final String header = "{\"alg\":\"none\",\"typ\":\"JWT\"}";
