* Change OAuthScopes into an interface as opposed to boilerplating annotations.

* Fixed errors because of boilerplating annotations.
This commit is contained in:
Adrian Cole 2014-11-11 20:15:56 -08:00
parent f3d2d3571c
commit 347926543e
41 changed files with 10 additions and 240 deletions

View File

@ -18,8 +18,6 @@ package org.jclouds.googlecomputeengine.compute.functions;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.Fallbacks.NullOnNotFoundOr404; import static org.jclouds.Fallbacks.NullOnNotFoundOr404;
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.net.URI;
@ -34,7 +32,6 @@ import org.jclouds.googlecomputeengine.domain.Instance;
import org.jclouds.googlecomputeengine.domain.Network; import org.jclouds.googlecomputeengine.domain.Network;
import org.jclouds.googlecomputeengine.domain.Operation; import org.jclouds.googlecomputeengine.domain.Operation;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
@ -49,30 +46,26 @@ public interface Resources {
/** Returns an instance by self-link or null if not found. */ /** Returns an instance by self-link or null if not found. */
@Named("Instances:get") @Named("Instances:get")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Nullable Instance instance(@EndpointParam URI selfLink); @Fallback(NullOnNotFoundOr404.class) @Nullable Instance instance(@EndpointParam URI selfLink);
/** Returns an network by self-link or null if not found. */ /** Returns an network by self-link or null if not found. */
@Named("Networks:get") @Named("Networks:get")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Nullable Network network(@EndpointParam URI selfLink); @Fallback(NullOnNotFoundOr404.class) @Nullable Network network(@EndpointParam URI selfLink);
/** Returns an operation by self-link or null if not found. */ /** Returns an operation by self-link or null if not found. */
@Named("Operations:get") @Named("Operations:get")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Nullable Operation operation(@EndpointParam URI selfLink); @Fallback(NullOnNotFoundOr404.class) @Nullable Operation operation(@EndpointParam URI selfLink);
/** Deletes any resource by self-link and returns the operation in progress, or null if not found. */ /** Deletes any resource by self-link and returns the operation in progress, or null if not found. */
@Named("Resources:delete") @Named("Resources:delete")
@DELETE @DELETE
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@EndpointParam URI selfLink); @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@EndpointParam URI selfLink);
/** Hard-resets the instance by self-link and returns the operation in progres */ /** Hard-resets the instance by self-link and returns the operation in progres */
@Named("Instances:reset") @Named("Instances:reset")
@POST @POST
@Path("/reset") @Path("/reset")
@OAuthScopes(COMPUTE_SCOPE) Operation resetInstance(@EndpointParam URI selfLink); Operation resetInstance(@EndpointParam URI selfLink);
} }

View File

@ -22,7 +22,6 @@ import static java.util.concurrent.TimeUnit.SECONDS;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.PROJECT_NAME; import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.PROJECT_NAME;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import static org.jclouds.rest.config.BinderUtils.bindHttpApi;
import java.net.URI; import java.net.URI;
@ -48,6 +47,7 @@ import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError; import org.jclouds.http.annotation.ServerError;
import org.jclouds.location.Provider; import org.jclouds.location.Provider;
import org.jclouds.oauth.v2.config.OAuthScopes; import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.config.OAuthScopes.ReadOrWriteScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.providers.ProviderMetadata; import org.jclouds.providers.ProviderMetadata;
import org.jclouds.rest.AuthorizationException; import org.jclouds.rest.AuthorizationException;
@ -65,12 +65,14 @@ import com.google.inject.Provides;
@ConfiguresHttpApi @ConfiguresHttpApi
public final class GoogleComputeEngineHttpApiModule extends HttpApiModule<GoogleComputeEngineApi> { public final class GoogleComputeEngineHttpApiModule extends HttpApiModule<GoogleComputeEngineApi> {
public GoogleComputeEngineHttpApiModule() {
}
@Override protected void configure() { @Override protected void configure() {
super.configure(); super.configure();
bindHttpApi(binder(), UseApiToResolveProjectName.GetProject.class); bindHttpApi(binder(), UseApiToResolveProjectName.GetProject.class);
bind(OAuthScopes.class).toInstance(ReadOrWriteScopes.create( //
"https://www.googleapis.com/auth/compute.readonly", //
"https://www.googleapis.com/auth/compute" //
));
} }
@Override protected void bindErrorHandlers() { @Override protected void bindErrorHandlers() {
@ -118,7 +120,6 @@ public final class GoogleComputeEngineHttpApiModule extends HttpApiModule<Google
@SkipEncoding({ '/', '=' }) @SkipEncoding({ '/', '=' })
@RequestFilters(OAuthAuthenticationFilter.class) @RequestFilters(OAuthAuthenticationFilter.class)
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Consumes(APPLICATION_JSON) @Consumes(APPLICATION_JSON)
interface GetProject { interface GetProject {
@Named("Projects:get") @Named("Projects:get")

View File

@ -1,28 +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.config;
/** OAuth scopes needed for requests. */
public final class GoogleComputeEngineScopes {
public static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute";
public static final String COMPUTE_READONLY_SCOPE = "https://www.googleapis.com/auth/compute.readonly";
private GoogleComputeEngineScopes() {
}
}

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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; import java.util.Iterator;
@ -41,7 +39,6 @@ import org.jclouds.googlecomputeengine.domain.Operation;
import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -63,7 +60,6 @@ public interface AddressApi {
@Named("Addresses:get") @Named("Addresses:get")
@GET @GET
@Path("/{address}") @Path("/{address}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Address get(@PathParam("address") String address); Address get(@PathParam("address") String address);
@ -78,7 +74,6 @@ public interface AddressApi {
@Named("Addresses:insert") @Named("Addresses:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation create(@PayloadParam("name") String address); Operation create(@PayloadParam("name") String address);
@ -86,7 +81,6 @@ public interface AddressApi {
@Named("Addresses:delete") @Named("Addresses:delete")
@DELETE @DELETE
@Path("/{address}") @Path("/{address}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("address") String address); Operation delete(@PathParam("address") String address);
@ -102,20 +96,17 @@ public interface AddressApi {
*/ */
@Named("Addresses:list") @Named("Addresses:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Address> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Address> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Addresses:list") @Named("Addresses:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(AddressPages.class) @Transform(AddressPages.class)
Iterator<ListPage<Address>> list(); Iterator<ListPage<Address>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Addresses:list") @Named("Addresses:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(AddressPages.class) @Transform(AddressPages.class)
Iterator<ListPage<Address>> list(ListOptions options); Iterator<ListPage<Address>> list(ListOptions options);

View File

@ -17,7 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import java.util.Iterator; import java.util.Iterator;
@ -35,7 +34,6 @@ import org.jclouds.googlecomputeengine.domain.MachineType;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.SkipEncoding; import org.jclouds.rest.annotations.SkipEncoding;
@ -47,7 +45,6 @@ import com.google.common.base.Function;
@RequestFilters(OAuthAuthenticationFilter.class) @RequestFilters(OAuthAuthenticationFilter.class)
@Path("/aggregated") @Path("/aggregated")
@Consumes(APPLICATION_JSON) @Consumes(APPLICATION_JSON)
@OAuthScopes(COMPUTE_READONLY_SCOPE)
public interface AggregatedListApi { public interface AggregatedListApi {
/** /**

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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; import java.util.Iterator;
@ -43,7 +41,6 @@ import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPa
import org.jclouds.googlecomputeengine.options.DiskCreationOptions; import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -65,7 +62,6 @@ public interface DiskApi {
@Named("Disks:get") @Named("Disks:get")
@GET @GET
@Path("/{disk}") @Path("/{disk}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Disk get(@PathParam("disk") String disk); Disk get(@PathParam("disk") String disk);
@ -81,7 +77,6 @@ public interface DiskApi {
@Named("Disks:insert") @Named("Disks:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation create(@PayloadParam("name") String diskName, @PayloadParam("sizeGb") int sizeGb); Operation create(@PayloadParam("name") String diskName, @PayloadParam("sizeGb") int sizeGb);
@ -97,7 +92,6 @@ public interface DiskApi {
@Named("Disks:insert") @Named("Disks:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(DiskCreationBinder.class) @MapBinder(DiskCreationBinder.class)
Operation create(@PayloadParam("name") String diskName, Operation create(@PayloadParam("name") String diskName,
@PayloadParam("sizeGb") int sizeGb, @PayloadParam("sizeGb") int sizeGb,
@ -107,7 +101,6 @@ public interface DiskApi {
@Named("Disks:delete") @Named("Disks:delete")
@DELETE @DELETE
@Path("/{disk}") @Path("/{disk}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("disk") String disk); Operation delete(@PathParam("disk") String disk);
@ -124,7 +117,6 @@ public interface DiskApi {
@Named("Disks:createSnapshot") @Named("Disks:createSnapshot")
@POST @POST
@Path("/{disk}/createSnapshot") @Path("/{disk}/createSnapshot")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation createSnapshot(@PathParam("disk") String diskName, @PayloadParam("name") String snapshotName); Operation createSnapshot(@PathParam("disk") String diskName, @PayloadParam("name") String snapshotName);
@ -139,20 +131,17 @@ public interface DiskApi {
*/ */
@Named("Disks:list") @Named("Disks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Disk> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Disk> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Disks:list") @Named("Disks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(DiskPages.class) @Transform(DiskPages.class)
Iterator<ListPage<Disk>> list(); Iterator<ListPage<Disk>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Disks:list") @Named("Disks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(DiskPages.class) @Transform(DiskPages.class)
Iterator<ListPage<Disk>> list(ListOptions options); Iterator<ListPage<Disk>> list(ListOptions options);

View File

@ -17,7 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import java.util.Iterator; import java.util.Iterator;
@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.ListPage;
import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
@ -49,7 +47,6 @@ import com.google.common.base.Function;
@RequestFilters(OAuthAuthenticationFilter.class) @RequestFilters(OAuthAuthenticationFilter.class)
@Path("/diskTypes") @Path("/diskTypes")
@Consumes(APPLICATION_JSON) @Consumes(APPLICATION_JSON)
@OAuthScopes(COMPUTE_READONLY_SCOPE)
public interface DiskTypeApi { public interface DiskTypeApi {
/** Returns a disk type by name or null if not found. */ /** Returns a disk type by name or null if not found. */

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.net.URI;
import java.util.Iterator; 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.FirewallOptions;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
@ -69,7 +66,6 @@ public interface FirewallApi {
@Named("Firewalls:get") @Named("Firewalls:get")
@GET @GET
@Path("/{firewall}") @Path("/{firewall}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Firewall get(@PathParam("firewall") String firewall); Firewall get(@PathParam("firewall") String firewall);
@ -86,7 +82,6 @@ public interface FirewallApi {
@Named("Firewalls:insert") @Named("Firewalls:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(FirewallBinder.class) @MapBinder(FirewallBinder.class)
Operation createInNetwork(@PayloadParam("name") String name, Operation createInNetwork(@PayloadParam("name") String name,
@PayloadParam("network") URI network, @PayloadParam("network") URI network,
@ -104,7 +99,6 @@ public interface FirewallApi {
@PUT @PUT
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@Path("/{firewall}") @Path("/{firewall}")
@OAuthScopes(COMPUTE_SCOPE)
Operation update(@PathParam("firewall") String firewall, Operation update(@PathParam("firewall") String firewall,
@BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions); @BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions);
@ -120,7 +114,6 @@ public interface FirewallApi {
@PATCH @PATCH
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@Path("/{firewall}") @Path("/{firewall}")
@OAuthScopes(COMPUTE_SCOPE)
Operation patch(@PathParam("firewall") String firewall, Operation patch(@PathParam("firewall") String firewall,
@BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions); @BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions);
@ -128,7 +121,6 @@ public interface FirewallApi {
@Named("Firewalls:delete") @Named("Firewalls:delete")
@DELETE @DELETE
@Path("/{firewall}") @Path("/{firewall}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
Operation delete(@PathParam("firewall") String firewall); Operation delete(@PathParam("firewall") String firewall);
@ -143,20 +135,17 @@ public interface FirewallApi {
*/ */
@Named("Firewalls:list") @Named("Firewalls:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Firewall> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Firewall> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Firewalls:list") @Named("Firewalls:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(FirewallPages.class) @Transform(FirewallPages.class)
Iterator<ListPage<Firewall>> list(); Iterator<ListPage<Firewall>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Firewalls:list") @Named("Firewalls:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(FirewallPages.class) @Transform(FirewallPages.class)
Iterator<ListPage<Firewall>> list(ListOptions options); Iterator<ListPage<Firewall>> list(ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.net.URI;
import java.util.Iterator; 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.ForwardingRuleCreationOptions;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticator; import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -66,7 +63,6 @@ public interface ForwardingRuleApi {
@Named("ForwardingRules:get") @Named("ForwardingRules:get")
@GET @GET
@Path("/{forwardingRule}") @Path("/{forwardingRule}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
ForwardingRule get(@PathParam("forwardingRule") String forwardingRule); ForwardingRule get(@PathParam("forwardingRule") String forwardingRule);
@ -81,7 +77,6 @@ public interface ForwardingRuleApi {
@Named("ForwardingRules:insert") @Named("ForwardingRules:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(ForwardingRuleCreationBinder.class) @MapBinder(ForwardingRuleCreationBinder.class)
Operation create(@PayloadParam("name") String forwardingRuleName, Operation create(@PayloadParam("name") String forwardingRuleName,
@PayloadParam("options") ForwardingRuleCreationOptions options); @PayloadParam("options") ForwardingRuleCreationOptions options);
@ -91,7 +86,6 @@ public interface ForwardingRuleApi {
@Named("ForwardingRules:delete") @Named("ForwardingRules:delete")
@DELETE @DELETE
@Path("/{forwardingRule}") @Path("/{forwardingRule}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("forwardingRule") String forwardingRule); Operation delete(@PathParam("forwardingRule") String forwardingRule);
@ -109,7 +103,6 @@ public interface ForwardingRuleApi {
@Named("ForwardingRules:setTarget") @Named("ForwardingRules:setTarget")
@POST @POST
@Path("/{forwardingRule}/setTarget") @Path("/{forwardingRule}/setTarget")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
@Nullable @Nullable
@ -126,20 +119,17 @@ public interface ForwardingRuleApi {
*/ */
@Named("ForwardingRules:list") @Named("ForwardingRules:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<ForwardingRule> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<ForwardingRule> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("ForwardingRules:list") @Named("ForwardingRules:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(ForwardingRulePages.class) @Transform(ForwardingRulePages.class)
Iterator<ListPage<ForwardingRule>> list(); Iterator<ListPage<ForwardingRule>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("ForwardingRules:list") @Named("ForwardingRules:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(ForwardingRulePages.class) @Transform(ForwardingRulePages.class)
Iterator<ListPage<ForwardingRule>> list(ListOptions options); Iterator<ListPage<ForwardingRule>> list(ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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; 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.HttpHealthCheckCreationOptions;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticator; import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -67,7 +64,6 @@ public interface HttpHealthCheckApi {
@Named("HttpHealthChecks:get") @Named("HttpHealthChecks:get")
@GET @GET
@Path("/{httpHealthCheck}") @Path("/{httpHealthCheck}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
HttpHealthCheck get(@PathParam("httpHealthCheck") String httpHealthCheck); HttpHealthCheck get(@PathParam("httpHealthCheck") String httpHealthCheck);
@ -82,7 +78,6 @@ public interface HttpHealthCheckApi {
@Named("HttpHealthChecks:insert") @Named("HttpHealthChecks:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation insert(@PayloadParam("name") String httpHealthCheckName); Operation insert(@PayloadParam("name") String httpHealthCheckName);
@ -96,7 +91,6 @@ public interface HttpHealthCheckApi {
@Named("HttpHealthChecks:insert") @Named("HttpHealthChecks:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(HttpHealthCheckCreationBinder.class) @MapBinder(HttpHealthCheckCreationBinder.class)
Operation insert(@PayloadParam("name") String name, @PayloadParam("options") HttpHealthCheckCreationOptions options); Operation insert(@PayloadParam("name") String name, @PayloadParam("options") HttpHealthCheckCreationOptions options);
@ -104,7 +98,6 @@ public interface HttpHealthCheckApi {
@Named("HttpHealthChecks:delete") @Named("HttpHealthChecks:delete")
@DELETE @DELETE
@Path("/{httpHealthCheck}") @Path("/{httpHealthCheck}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("httpHealthCheck") String httpHealthCheck); Operation delete(@PathParam("httpHealthCheck") String httpHealthCheck);
@ -121,7 +114,6 @@ public interface HttpHealthCheckApi {
@Named("HttpHealthChecks:patch") @Named("HttpHealthChecks:patch")
@PATCH @PATCH
@Path("/{httpHealthCheck}") @Path("/{httpHealthCheck}")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(HttpHealthCheckCreationBinder.class) @MapBinder(HttpHealthCheckCreationBinder.class)
@Nullable @Nullable
Operation patch(@PathParam("httpHealthCheck") @PayloadParam("name") String name, Operation patch(@PathParam("httpHealthCheck") @PayloadParam("name") String name,
@ -140,7 +132,6 @@ public interface HttpHealthCheckApi {
@PUT @PUT
@Path("/{httpHealthCheck}") @Path("/{httpHealthCheck}")
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(HttpHealthCheckCreationBinder.class) @MapBinder(HttpHealthCheckCreationBinder.class)
Operation update(@PathParam("httpHealthCheck") @PayloadParam("name") String name, Operation update(@PathParam("httpHealthCheck") @PayloadParam("name") String name,
@PayloadParam("options") HttpHealthCheckCreationOptions options); @PayloadParam("options") HttpHealthCheckCreationOptions options);
@ -156,20 +147,17 @@ public interface HttpHealthCheckApi {
*/ */
@Named("HttpHealthChecks:list") @Named("HttpHealthChecks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<HttpHealthCheck> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<HttpHealthCheck> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("HttpHealthChecks:list") @Named("HttpHealthChecks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(HttpHealthCheckPages.class) @Transform(HttpHealthCheckPages.class)
Iterator<ListPage<HttpHealthCheck>> list(); Iterator<ListPage<HttpHealthCheck>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("HttpHealthChecks:list") @Named("HttpHealthChecks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(HttpHealthCheckPages.class) @Transform(HttpHealthCheckPages.class)
Iterator<ListPage<HttpHealthCheck>> list(ListOptions options); Iterator<ListPage<HttpHealthCheck>> list(ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.net.URI;
import java.util.Iterator; import java.util.Iterator;
@ -44,7 +42,6 @@ import org.jclouds.googlecomputeengine.internal.BaseArg0ToIteratorOfListPage;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Endpoint; import org.jclouds.rest.annotations.Endpoint;
import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.EndpointParam;
@ -66,7 +63,6 @@ public interface ImageApi {
/** Returns an image by self-link or null if not found. */ /** Returns an image by self-link or null if not found. */
@Named("Images:get") @Named("Images:get")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Image get(@EndpointParam URI selfLink); Image get(@EndpointParam URI selfLink);
@ -76,7 +72,6 @@ public interface ImageApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/images/{image}") @Path("/global/images/{image}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Image get(@PathParam("image") String image); Image get(@PathParam("image") String image);
@ -86,7 +81,6 @@ public interface ImageApi {
@DELETE @DELETE
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/images/{image}") @Path("/global/images/{image}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("image") String image); Operation delete(@PathParam("image") String image);
@ -104,7 +98,6 @@ public interface ImageApi {
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/images") @Path("/global/images")
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation createFromDisk(@PayloadParam("name") String image, @PayloadParam("sourceDisk") String sourceDisk); Operation createFromDisk(@PayloadParam("name") String image, @PayloadParam("sourceDisk") String sourceDisk);
@ -121,7 +114,6 @@ public interface ImageApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/images") @Path("/global/images")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Image> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Image> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@ -129,7 +121,6 @@ public interface ImageApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/images") @Path("/global/images")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(ImagePages.class) @Transform(ImagePages.class)
Iterator<ListPage<Image>> list(); Iterator<ListPage<Image>> list();
@ -138,7 +129,6 @@ public interface ImageApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/images") @Path("/global/images")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(ImagePages.class) @Transform(ImagePages.class)
Iterator<ListPage<Image>> list(ListOptions options); Iterator<ListPage<Image>> list(ListOptions options);
@ -171,7 +161,6 @@ public interface ImageApi {
@Named("Images:list") @Named("Images:list")
@GET @GET
@Path("/projects/{project}/global/images") @Path("/projects/{project}/global/images")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Image> listPageInProject(@PathParam("project") String projectName, ListPage<Image> listPageInProject(@PathParam("project") String projectName,
@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
@ -181,7 +170,6 @@ public interface ImageApi {
@Named("Images:list") @Named("Images:list")
@GET @GET
@Path("/projects/{project}/global/images") @Path("/projects/{project}/global/images")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(ImagePagesInProject.class) @Transform(ImagePagesInProject.class)
Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName); Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName);
@ -191,7 +179,6 @@ public interface ImageApi {
@Named("Images:list") @Named("Images:list")
@GET @GET
@Path("/projects/{project}/global/images") @Path("/projects/{project}/global/images")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(ImagePagesInProject.class) @Transform(ImagePagesInProject.class)
Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName, ListOptions options); Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName, ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.NetworkInterface.AccessConfig;
import static org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput; 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.AttachDiskOptions;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
@ -69,7 +66,6 @@ public interface InstanceApi {
@Named("Instances:get") @Named("Instances:get")
@GET @GET
@Path("/{instance}") @Path("/{instance}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Instance get(@PathParam("instance") String instance); Instance get(@PathParam("instance") String instance);
@ -84,14 +80,12 @@ public interface InstanceApi {
@Named("Instances:insert") @Named("Instances:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
Operation create(@BinderParam(BindToJsonPayload.class) NewInstance template); Operation create(@BinderParam(BindToJsonPayload.class) NewInstance template);
/** Deletes an instance by name and returns the operation in progress, or null if not found. */ /** Deletes an instance by name and returns the operation in progress, or null if not found. */
@Named("Instances:delete") @Named("Instances:delete")
@DELETE @DELETE
@Path("/{instance}") @Path("/{instance}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("instance") String instance); Operation delete(@PathParam("instance") String instance);
@ -109,7 +103,6 @@ public interface InstanceApi {
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@Path("/{instance}/addAccessConfig") @Path("/{instance}/addAccessConfig")
@OAuthScopes(COMPUTE_SCOPE)
Operation addAccessConfigToNic(@PathParam("instance") String instance, Operation addAccessConfigToNic(@PathParam("instance") String instance,
@BinderParam(BindToJsonPayload.class) @BinderParam(BindToJsonPayload.class)
AccessConfig accessConfig, AccessConfig accessConfig,
@ -127,7 +120,6 @@ public interface InstanceApi {
@Named("Instances:deleteAccessConfig") @Named("Instances:deleteAccessConfig")
@DELETE @DELETE
@Path("/{instance}/deleteAccessConfig") @Path("/{instance}/deleteAccessConfig")
@OAuthScopes(COMPUTE_SCOPE)
Operation deleteAccessConfigFromNic(@PathParam("instance") String instance, Operation deleteAccessConfigFromNic(@PathParam("instance") String instance,
@QueryParam("access_config") String accessConfigName, @QueryParam("access_config") String accessConfigName,
@QueryParam("network_interface") String networkInterfaceName); @QueryParam("network_interface") String networkInterfaceName);
@ -141,7 +133,6 @@ public interface InstanceApi {
@Named("Instances:serialPort") @Named("Instances:serialPort")
@GET @GET
@Path("/{instance}/serialPort") @Path("/{instance}/serialPort")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
SerialPortOutput getSerialPortOutput(@PathParam("instance") String instance); SerialPortOutput getSerialPortOutput(@PathParam("instance") String instance);
/** /**
@ -154,7 +145,6 @@ public interface InstanceApi {
@Named("Instances:reset") @Named("Instances:reset")
@POST @POST
@Path("/{instance}/reset") @Path("/{instance}/reset")
@OAuthScopes(COMPUTE_SCOPE)
Operation reset(@PathParam("instance") String instance); Operation reset(@PathParam("instance") String instance);
/** /**
@ -170,7 +160,6 @@ public interface InstanceApi {
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@Path("/{instance}/attachDisk") @Path("/{instance}/attachDisk")
@OAuthScopes(COMPUTE_SCOPE)
Operation attachDisk(@PathParam("instance") String instance, Operation attachDisk(@PathParam("instance") String instance,
@BinderParam(BindToJsonPayload.class) AttachDiskOptions attachDiskOptions); @BinderParam(BindToJsonPayload.class) AttachDiskOptions attachDiskOptions);
@ -186,7 +175,6 @@ public interface InstanceApi {
@Named("Instances:detachDisk") @Named("Instances:detachDisk")
@POST @POST
@Path("/{instance}/detachDisk") @Path("/{instance}/detachDisk")
@OAuthScopes(COMPUTE_SCOPE)
Operation detachDisk(@PathParam("instance") String instance, @QueryParam("deviceName") String deviceName); Operation detachDisk(@PathParam("instance") String instance, @QueryParam("deviceName") String deviceName);
/** /**
@ -209,8 +197,6 @@ public interface InstanceApi {
@Named("Instances:setMetadata") @Named("Instances:setMetadata")
@POST @POST
@Path("/{instance}/setMetadata") @Path("/{instance}/setMetadata")
@OAuthScopes(COMPUTE_SCOPE)
@Produces(APPLICATION_JSON)
Operation setMetadata(@PathParam("instance") String instance, Operation setMetadata(@PathParam("instance") String instance,
@BinderParam(BindToJsonPayload.class) Metadata metadata); @BinderParam(BindToJsonPayload.class) Metadata metadata);
@ -226,7 +212,6 @@ public interface InstanceApi {
@Named("Instances:setTags") @Named("Instances:setTags")
@POST @POST
@Path("/{instance}/setTags") @Path("/{instance}/setTags")
@OAuthScopes(COMPUTE_SCOPE)
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation setTags(@PathParam("instance") String instance, Operation setTags(@PathParam("instance") String instance,
@ -244,20 +229,17 @@ public interface InstanceApi {
*/ */
@Named("Instances:list") @Named("Instances:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Instance> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Instance> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Instances:list") @Named("Instances:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(InstancePages.class) @Transform(InstancePages.class)
Iterator<ListPage<Instance>> list(); Iterator<ListPage<Instance>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Instances:list") @Named("Instances:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(InstancePages.class) @Transform(InstancePages.class)
Iterator<ListPage<Instance>> list(ListOptions options); Iterator<ListPage<Instance>> list(ListOptions options);

View File

@ -17,7 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import java.util.Iterator; import java.util.Iterator;
@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.MachineType;
import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
@ -55,7 +53,6 @@ public interface MachineTypeApi {
@Named("MachineTypes:get") @Named("MachineTypes:get")
@GET @GET
@Path("/{machineType}") @Path("/{machineType}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
MachineType get(@PathParam("machineType") String machineType); MachineType get(@PathParam("machineType") String machineType);
@ -70,20 +67,17 @@ public interface MachineTypeApi {
*/ */
@Named("MachineTypes:list") @Named("MachineTypes:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<MachineType> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<MachineType> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("MachineTypes:list") @Named("MachineTypes:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(MachineTypePages.class) @Transform(MachineTypePages.class)
Iterator<ListPage<MachineType>> list(); Iterator<ListPage<MachineType>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("MachineTypes:list") @Named("MachineTypes:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(MachineTypePages.class) @Transform(MachineTypePages.class)
Iterator<ListPage<MachineType>> list(ListOptions options); Iterator<ListPage<MachineType>> list(ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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; import java.util.Iterator;
@ -41,7 +39,6 @@ import org.jclouds.googlecomputeengine.domain.Operation;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -63,7 +60,6 @@ public interface NetworkApi {
@Named("Networks:get") @Named("Networks:get")
@GET @GET
@Path("/{network}") @Path("/{network}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
Network get(@PathParam("network") String networkName); Network get(@PathParam("network") String networkName);
@ -78,7 +74,6 @@ public interface NetworkApi {
@Named("Networks:insert") @Named("Networks:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation createInIPv4Range(@PayloadParam("name") String networkName, Operation createInIPv4Range(@PayloadParam("name") String networkName,
@PayloadParam("IPv4Range") String IPv4Range); @PayloadParam("IPv4Range") String IPv4Range);
@ -95,7 +90,6 @@ public interface NetworkApi {
@Named("Networks:insert") @Named("Networks:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
Operation createInIPv4RangeWithGateway(@PayloadParam("name") String networkName, Operation createInIPv4RangeWithGateway(@PayloadParam("name") String networkName,
@PayloadParam("IPv4Range") String IPv4Range, @PayloadParam("IPv4Range") String IPv4Range,
@ -105,7 +99,6 @@ public interface NetworkApi {
@Named("Networks:delete") @Named("Networks:delete")
@DELETE @DELETE
@Path("/{network}") @Path("/{network}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
Operation delete(@PathParam("network") String networkName); Operation delete(@PathParam("network") String networkName);
@ -120,20 +113,17 @@ public interface NetworkApi {
*/ */
@Named("Networks:list") @Named("Networks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Network> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Network> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Networks:list") @Named("Networks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(NetworkPages.class) @Transform(NetworkPages.class)
Iterator<ListPage<Network>> list(); Iterator<ListPage<Network>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Networks:list") @Named("Networks:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(NetworkPages.class) @Transform(NetworkPages.class)
Iterator<ListPage<Network>> list(ListOptions options); Iterator<ListPage<Network>> list(ListOptions options);

View File

@ -18,8 +18,6 @@ package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.Fallbacks.VoidOnNotFoundOr404; 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.net.URI;
import java.util.Iterator; import java.util.Iterator;
@ -42,7 +40,6 @@ import org.jclouds.googlecomputeengine.internal.BaseArg0ToIteratorOfListPage;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Endpoint; import org.jclouds.rest.annotations.Endpoint;
import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.EndpointParam;
@ -61,7 +58,6 @@ public interface OperationApi {
/** Returns an operation by self-link or null if not found. */ /** Returns an operation by self-link or null if not found. */
@Named("Operations:get") @Named("Operations:get")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation get(@EndpointParam URI operation); Operation get(@EndpointParam URI operation);
@ -69,7 +65,6 @@ public interface OperationApi {
/** Deletes an operation by name. */ /** Deletes an operation by name. */
@Named("Operations:delete") @Named("Operations:delete")
@DELETE @DELETE
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(VoidOnNotFoundOr404.class) @Fallback(VoidOnNotFoundOr404.class)
void delete(@EndpointParam URI operation); void delete(@EndpointParam URI operation);
@ -86,7 +81,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/operations") @Path("/global/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Operation> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Operation> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@ -94,7 +88,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/operations") @Path("/global/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(OperationPages.class) @Transform(OperationPages.class)
Iterator<ListPage<Operation>> list(); Iterator<ListPage<Operation>> list();
@ -103,7 +96,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/global/operations") @Path("/global/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(OperationPages.class) @Transform(OperationPages.class)
Iterator<ListPage<Operation>> list(ListOptions options); Iterator<ListPage<Operation>> list(ListOptions options);
@ -137,7 +129,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/regions/{region}/operations") @Path("/regions/{region}/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Operation> listPageInRegion(@PathParam("region") String region, ListPage<Operation> listPageInRegion(@PathParam("region") String region,
@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
@ -146,7 +137,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/regions/{region}/operations") @Path("/regions/{region}/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(OperationPagesInRegion.class) @Transform(OperationPagesInRegion.class)
Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region); Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region);
@ -155,7 +145,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/regions/{region}/operations") @Path("/regions/{region}/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(OperationPagesInRegion.class) @Transform(OperationPagesInRegion.class)
Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region, ListOptions options); Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region, ListOptions options);
@ -191,7 +180,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/zones/{zone}/operations") @Path("/zones/{zone}/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Operation> listPageInZone(@PathParam("zone") String zone, ListPage<Operation> listPageInZone(@PathParam("zone") String zone,
@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
@ -200,7 +188,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/zones/{zone}/operations") @Path("/zones/{zone}/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(OperationPagesInZone.class) @Transform(OperationPagesInZone.class)
Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone); Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone);
@ -209,7 +196,6 @@ public interface OperationApi {
@GET @GET
@Endpoint(CurrentProject.class) @Endpoint(CurrentProject.class)
@Path("/zones/{zone}/operations") @Path("/zones/{zone}/operations")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(OperationPagesInZone.class) @Transform(OperationPagesInZone.class)
Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone, ListOptions options); Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone, ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.inject.Named;
import javax.ws.rs.Consumes; 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.Metadata;
import org.jclouds.googlecomputeengine.domain.Operation; import org.jclouds.googlecomputeengine.domain.Operation;
import org.jclouds.googlecomputeengine.domain.Project; import org.jclouds.googlecomputeengine.domain.Project;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
@ -47,7 +44,6 @@ public interface ProjectApi {
/** Get the current project. */ /** Get the current project. */
@Named("Projects:get") @Named("Projects:get")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOn400or404.class) @Fallback(NullOn400or404.class)
Project get(); Project get();
@ -69,7 +65,6 @@ public interface ProjectApi {
@Named("Projects:setCommonInstanceMetadata") @Named("Projects:setCommonInstanceMetadata")
@POST @POST
@Path("/setCommonInstanceMetadata") @Path("/setCommonInstanceMetadata")
@OAuthScopes(COMPUTE_SCOPE)
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
Operation setCommonInstanceMetadata(@BinderParam(BindToJsonPayload.class) Metadata metadata); Operation setCommonInstanceMetadata(@BinderParam(BindToJsonPayload.class) Metadata metadata);
} }

View File

@ -17,7 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import java.util.Iterator; import java.util.Iterator;
@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.Region;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
@ -49,7 +47,6 @@ import com.google.common.base.Function;
@RequestFilters(OAuthAuthenticationFilter.class) @RequestFilters(OAuthAuthenticationFilter.class)
@Path("/regions") @Path("/regions")
@Consumes(APPLICATION_JSON) @Consumes(APPLICATION_JSON)
@OAuthScopes(COMPUTE_READONLY_SCOPE)
public interface RegionApi { public interface RegionApi {
/** Returns a region by name or null if not found. */ /** Returns a region by name or null if not found. */

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.net.URI;
import java.util.Iterator; 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.ListOptions;
import org.jclouds.googlecomputeengine.options.RouteOptions; import org.jclouds.googlecomputeengine.options.RouteOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -65,16 +62,13 @@ public interface RouteApi {
@Named("Routes:get") @Named("Routes:get")
@GET @GET
@Path("/{route}") @Path("/{route}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
Route get(@PathParam("route") String routeName); Route get(@PathParam("route") String routeName);
/** Deletes a route by name and returns the operation in progress, or null if not found. */ /** Deletes a route by name and returns the operation in progress, or null if not found. */
@Named("Routes:delete") @Named("Routes:delete")
@DELETE @DELETE
@Consumes(APPLICATION_JSON)
@Path("/{route}") @Path("/{route}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("route") String routeName); Operation delete(@PathParam("route") String routeName);
@ -90,9 +84,7 @@ public interface RouteApi {
*/ */
@Named("Routes:insert") @Named("Routes:insert")
@POST @POST
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(RouteBinder.class) @MapBinder(RouteBinder.class)
Operation createInNetwork(@PayloadParam("name") String name, Operation createInNetwork(@PayloadParam("name") String name,
@PayloadParam("network") URI network, @PayloadParam("network") URI network,
@ -109,20 +101,17 @@ public interface RouteApi {
*/ */
@Named("Routes:list") @Named("Routes:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Route> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Route> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Routes:list") @Named("Routes:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(RoutePages.class) @Transform(RoutePages.class)
Iterator<ListPage<Route>> list(); Iterator<ListPage<Route>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Routes:list") @Named("Routes:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(RoutePages.class) @Transform(RoutePages.class)
Iterator<ListPage<Route>> list(ListOptions options); Iterator<ListPage<Route>> list(ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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; import java.util.Iterator;
@ -39,7 +37,6 @@ import org.jclouds.googlecomputeengine.domain.Snapshot;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
@ -58,7 +55,6 @@ public interface SnapshotApi {
@Named("Snapshots:get") @Named("Snapshots:get")
@GET @GET
@Path("/{snapshot}") @Path("/{snapshot}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Snapshot get(@PathParam("snapshot") String snapshot); Snapshot get(@PathParam("snapshot") String snapshot);
@ -67,7 +63,6 @@ public interface SnapshotApi {
@Named("Snapshots:delete") @Named("Snapshots:delete")
@DELETE @DELETE
@Path("/{snapshot}") @Path("/{snapshot}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("snapshot") String snapshot); Operation delete(@PathParam("snapshot") String snapshot);
@ -83,20 +78,17 @@ public interface SnapshotApi {
*/ */
@Named("Snapshots:list") @Named("Snapshots:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<Snapshot> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<Snapshot> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Snapshots:list") @Named("Snapshots:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(SnapshotPages.class) @Transform(SnapshotPages.class)
Iterator<ListPage<Snapshot>> list(); Iterator<ListPage<Snapshot>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("Snapshots:list") @Named("Snapshots:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(SnapshotPages.class) @Transform(SnapshotPages.class)
Iterator<ListPage<Snapshot>> list(ListOptions options); Iterator<ListPage<Snapshot>> list(ListOptions options);

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.net.URI;
import java.util.Iterator; 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.ListOptions;
import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions; import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticator; import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.MapBinder; import org.jclouds.rest.annotations.MapBinder;
@ -69,7 +66,6 @@ public interface TargetPoolApi {
@Named("TargetPools:get") @Named("TargetPools:get")
@GET @GET
@Path("/{targetPool}") @Path("/{targetPool}")
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
TargetPool get(@PathParam("targetPool") String targetPool); TargetPool get(@PathParam("targetPool") String targetPool);
@ -85,8 +81,6 @@ public interface TargetPoolApi {
@Named("TargetPools:insert") @Named("TargetPools:insert")
@POST @POST
@Produces(APPLICATION_JSON) @Produces(APPLICATION_JSON)
@Path("")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(TargetPoolCreationBinder.class) @MapBinder(TargetPoolCreationBinder.class)
Operation create(@PayloadParam("name") String name, @PayloadParam("options") TargetPoolCreationOptions options); Operation create(@PayloadParam("name") String name, @PayloadParam("options") TargetPoolCreationOptions options);
@ -94,7 +88,6 @@ public interface TargetPoolApi {
@Named("TargetPools:delete") @Named("TargetPools:delete")
@DELETE @DELETE
@Path("/{targetPool}") @Path("/{targetPool}")
@OAuthScopes(COMPUTE_SCOPE)
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@Nullable @Nullable
Operation delete(@PathParam("targetPool") String targetPool); Operation delete(@PathParam("targetPool") String targetPool);
@ -111,7 +104,6 @@ public interface TargetPoolApi {
@Named("TargetPools:addInstance") @Named("TargetPools:addInstance")
@POST @POST
@Path("/{targetPool}/addInstance") @Path("/{targetPool}/addInstance")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(TargetPoolChangeInstancesBinder.class) @MapBinder(TargetPoolChangeInstancesBinder.class)
@Nullable @Nullable
Operation addInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances); Operation addInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances);
@ -128,7 +120,6 @@ public interface TargetPoolApi {
@Named("TargetPools:removeInstance") @Named("TargetPools:removeInstance")
@POST @POST
@Path("/{targetPool}/removeInstance") @Path("/{targetPool}/removeInstance")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(TargetPoolChangeInstancesBinder.class) @MapBinder(TargetPoolChangeInstancesBinder.class)
@Nullable @Nullable
Operation removeInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances); Operation removeInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances);
@ -145,7 +136,6 @@ public interface TargetPoolApi {
@Named("TargetPools:addHealthCheck") @Named("TargetPools:addHealthCheck")
@POST @POST
@Path("/{targetPool}/addHealthCheck") @Path("/{targetPool}/addHealthCheck")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(TargetPoolChangeHealthChecksBinder.class) @MapBinder(TargetPoolChangeHealthChecksBinder.class)
@Nullable @Nullable
Operation addHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks); Operation addHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks);
@ -163,7 +153,6 @@ public interface TargetPoolApi {
@Named("TargetPools:removeHealthChek") @Named("TargetPools:removeHealthChek")
@POST @POST
@Path("/{targetPool}/removeHealthCheck") @Path("/{targetPool}/removeHealthCheck")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(TargetPoolChangeHealthChecksBinder.class) @MapBinder(TargetPoolChangeHealthChecksBinder.class)
@Nullable @Nullable
Operation removeHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks); Operation removeHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks);
@ -184,7 +173,6 @@ public interface TargetPoolApi {
@Named("TargetPools:setBackup") @Named("TargetPools:setBackup")
@POST @POST
@Path("/{targetPool}/setBackup") @Path("/{targetPool}/setBackup")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
@Nullable @Nullable
Operation setBackup(@PathParam("targetPool") String targetPool, @PayloadParam("target") URI target); Operation setBackup(@PathParam("targetPool") String targetPool, @PayloadParam("target") URI target);
@ -201,7 +189,6 @@ public interface TargetPoolApi {
@Named("TargetPools:setBackup") @Named("TargetPools:setBackup")
@POST @POST
@Path("/{targetPool}/setBackup") @Path("/{targetPool}/setBackup")
@OAuthScopes(COMPUTE_SCOPE)
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
@Nullable @Nullable
Operation setBackup(@PathParam("targetPool") String targetPool, @QueryParam("failoverRatio") Float failoverRatio, @PayloadParam("target") URI target); Operation setBackup(@PathParam("targetPool") String targetPool, @QueryParam("failoverRatio") Float failoverRatio, @PayloadParam("target") URI target);
@ -217,20 +204,17 @@ public interface TargetPoolApi {
*/ */
@Named("TargetPools:list") @Named("TargetPools:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
ListPage<TargetPool> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions); ListPage<TargetPool> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("TargetPools:list") @Named("TargetPools:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(TargetPoolPages.class) @Transform(TargetPoolPages.class)
Iterator<ListPage<TargetPool>> list(); Iterator<ListPage<TargetPool>> list();
/** @see #listPage(String, ListOptions) */ /** @see #listPage(String, ListOptions) */
@Named("TargetPools:list") @Named("TargetPools:list")
@GET @GET
@OAuthScopes(COMPUTE_READONLY_SCOPE)
@Transform(TargetPoolPages.class) @Transform(TargetPoolPages.class)
Iterator<ListPage<TargetPool>> list(ListOptions options); Iterator<ListPage<TargetPool>> list(ListOptions options);

View File

@ -17,7 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import java.util.Iterator; import java.util.Iterator;
@ -36,7 +35,6 @@ import org.jclouds.googlecomputeengine.domain.Zone;
import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage; import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
import org.jclouds.googlecomputeengine.options.ListOptions; import org.jclouds.googlecomputeengine.options.ListOptions;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.oauth.v2.config.OAuthScopes;
import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter; import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
import org.jclouds.rest.annotations.Fallback; import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
@ -49,7 +47,6 @@ import com.google.common.base.Function;
@RequestFilters(OAuthAuthenticationFilter.class) @RequestFilters(OAuthAuthenticationFilter.class)
@Path("/zones") @Path("/zones")
@Consumes(APPLICATION_JSON) @Consumes(APPLICATION_JSON)
@OAuthScopes(COMPUTE_READONLY_SCOPE)
public interface ZoneApi { public interface ZoneApi {
/** Returns a zone by name or null if not found. */ /** Returns a zone by name or null if not found. */

View File

@ -18,7 +18,6 @@ package org.jclouds.googlecomputeengine;
import java.util.Properties; import java.util.Properties;
import org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes;
import org.jclouds.googlecomputeengine.internal.TestProperties; import org.jclouds.googlecomputeengine.internal.TestProperties;
import org.jclouds.oauth.v2.internal.BaseOAuthAuthenticatedApiLiveTest; import org.jclouds.oauth.v2.internal.BaseOAuthAuthenticatedApiLiveTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -32,7 +31,7 @@ public class GoogleComputeEngineAuthenticatedRestContextLiveTest extends BaseOAu
@Override @Override
public String getScopes() { public String getScopes() {
return GoogleComputeEngineScopes.COMPUTE_SCOPE; return "https://www.googleapis.com/auth/compute";
} }
@Override protected Properties setupProperties() { @Override protected Properties setupProperties() {

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,7 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;

View File

@ -19,8 +19,6 @@ package org.jclouds.googlecomputeengine.features;
import static com.google.common.base.Joiner.on; import static com.google.common.base.Joiner.on;
import static com.google.common.collect.Iterables.transform; import static com.google.common.collect.Iterables.transform;
import static java.lang.String.format; 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.io.Payloads.newStringPayload;
import static org.jclouds.util.Strings2.toStringAndClose; import static org.jclouds.util.Strings2.toStringAndClose;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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_REQUEST;
import static org.jclouds.googlecomputeengine.features.ProjectApiExpectTest.GET_PROJECT_RESPONSE; import static org.jclouds.googlecomputeengine.features.ProjectApiExpectTest.GET_PROJECT_RESPONSE;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;

View File

@ -16,7 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;

View File

@ -17,8 +17,6 @@
package org.jclouds.googlecomputeengine.features; package org.jclouds.googlecomputeengine.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON; 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.assertEquals;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;

View File

@ -16,7 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,7 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;

View File

@ -16,8 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertNull;

View File

@ -16,7 +16,6 @@
*/ */
package org.jclouds.googlecomputeengine.features; 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.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;

View File

@ -40,6 +40,8 @@ import com.google.common.base.Joiner;
import com.google.inject.Module; import com.google.inject.Module;
public class BaseGoogleComputeEngineExpectTest<T> extends BaseRestApiExpectTest<T> { 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"; protected static final String BASE_URL = "https://www.googleapis.com/compute/v1/projects";
private static final String header = "{\"alg\":\"none\",\"typ\":\"JWT\"}"; private static final String header = "{\"alg\":\"none\",\"typ\":\"JWT\"}";

View File

@ -14,9 +14,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jclouds.googlecomputeengine.functions.internal; package org.jclouds.googlecomputeengine.internal;
import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults; import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
@ -32,7 +31,6 @@ import org.jclouds.googlecomputeengine.domain.ListPage;
import org.jclouds.googlecomputeengine.features.AddressApi; import org.jclouds.googlecomputeengine.features.AddressApi;
import org.jclouds.googlecomputeengine.features.ImageApi; import org.jclouds.googlecomputeengine.features.ImageApi;
import org.jclouds.googlecomputeengine.features.InstanceApi; import org.jclouds.googlecomputeengine.features.InstanceApi;
import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
import org.jclouds.googlecomputeengine.parse.ParseAddressTest; import org.jclouds.googlecomputeengine.parse.ParseAddressTest;
import org.jclouds.googlecomputeengine.parse.ParseImageTest; import org.jclouds.googlecomputeengine.parse.ParseImageTest;
import org.jclouds.googlecomputeengine.parse.ParseInstanceTest; import org.jclouds.googlecomputeengine.parse.ParseInstanceTest;