You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2015/06/26 15:00:43 UTC
[01/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Repository: jclouds-labs-google
Updated Branches:
refs/heads/master 413b03b6b -> cf9af8344
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/test/java/org/jclouds/googlecloud/internal/TestProperties.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/test/java/org/jclouds/googlecloud/internal/TestProperties.java b/googlecloud/src/test/java/org/jclouds/googlecloud/internal/TestProperties.java
deleted file mode 100644
index 91b2f48..0000000
--- a/googlecloud/src/test/java/org/jclouds/googlecloud/internal/TestProperties.java
+++ /dev/null
@@ -1,108 +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.googlecloud.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Throwables.propagate;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.CREDENTIAL_TYPE;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.PROJECT_NAME;
-import static org.jclouds.oauth.v2.config.CredentialType.P12_PRIVATE_KEY_CREDENTIALS;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.util.Properties;
-
-import org.jclouds.domain.Credentials;
-import org.jclouds.googlecloud.GoogleCredentialsFromJson;
-import org.jclouds.oauth.v2.config.CredentialType;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-/** Changes to this mandate changes to pom.xml and README.md */
-public final class TestProperties {
-
- public static Properties apply(String provider, Properties props) {
- setIfTestSystemPropertyPresent(props, PROJECT_NAME);
- setIfTestSystemPropertyPresent(props, CREDENTIAL_TYPE);
- if (props.containsKey(CREDENTIAL_TYPE)
- && CredentialType.fromValue(props.getProperty(CREDENTIAL_TYPE)) == P12_PRIVATE_KEY_CREDENTIALS) {
- setCredential(props, provider + ".credential");
- }
- return props;
- }
-
- // TODO: make BaseApiLiveTest.setIfTestSystemPropertyPresent static
- private static String setIfTestSystemPropertyPresent(Properties overrides, String key) {
- if (System.getProperties().containsKey("test." + key)) {
- String val = System.getProperty("test." + key);
- overrides.setProperty(key, val);
- return val;
- }
- return null;
- }
-
- // TODO: move to jclouds-core
- public static String setCredential(Properties overrides, String key) {
- String val = null;
- String credentialFromFile = null;
- String testKey = "test." + key;
-
- if (System.getProperties().containsKey(testKey)) {
- val = System.getProperty(testKey);
- }
- checkNotNull(val,
- String.format("the property %s must be set (pem private key file path or private key as a string)",
- testKey));
-
- if (val.startsWith("-----BEGIN")) {
- return val;
- }
-
- try {
- credentialFromFile = Files.toString(new File(val), Charsets.UTF_8);
- } catch (IOException e) {
- throw propagate(e);
- }
- overrides.setProperty(key, credentialFromFile);
- return credentialFromFile;
- }
-
- /*
- * Provides an easy way to pass in credentials using the json-key format.
- * Just provide the path to the .json file as the system property test.google-cloud.json-key
- * and this extracts and sets identity and credentials from the json.
- */
- public static void setGoogleCredentialsFromJson(String provider) {
- String key = "test.google-cloud.json-key";
- if (System.getProperties().containsKey(key)) {
- String val = System.getProperty(key);
- try {
- String fileContents = Files.toString(new File(val), Charset.defaultCharset());
- Credentials creds = new GoogleCredentialsFromJson(fileContents).get();
- System.setProperty("test." + provider + ".identity", creds.identity);
- System.setProperty("test." + provider + ".credential", creds.credential);
- } catch (IOException e) {
- throw propagate(e);
- }
- }
- }
-
- private TestProperties() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 93b4ec5..69703a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,8 +54,6 @@
</repositories>
<modules>
- <module>googlecloud</module>
- <module>google-compute-engine</module>
<module>google-cloud-storage</module>
</modules>
[13/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/BackendServiceApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/BackendServiceApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/BackendServiceApi.java
deleted file mode 100644
index 629a342..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/BackendServiceApi.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.BackendService;
-import org.jclouds.googlecomputeengine.domain.HealthStatus;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PATCH;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface BackendServiceApi {
- /**
- * Returns the specified backend service resource.
- *
- * @param backendServiceName name of the backend service resource to return.
- * @return a BackendService resource.
- */
- @Named("BackendServices:get")
- @GET
- @Path("/{backendService}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- BackendService get(@PathParam("backendService") String backendServiceName);
-
- /**
- * Creates a backend service resource in the specified project using the data
- * included in the request.
- *
- * @param backendService options for this backend service.
- * @return an Operation resource. To check on the status of an operation,
- * poll the Operations resource returned to you, and look for the
- * status field.
- */
- @Named("BackendServices:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) BackendServiceOptions backendService);
-
- /**
- * Updates the specified backend service resource with the data included in
- * the request.
- *
- * @param backendServiceName the name backend service to be updated.
- * @param backendServiceOptions the new backend service.
- * @return an Operation resource. To check on the status of an operation,
- * poll the Operations resource returned to you, and look for the
- * status field.
- */
- @Named("BackendServices:update")
- @PUT
- @Produces(APPLICATION_JSON)
- @Path("/{backendService}")
- Operation update(@PathParam("backendService") String backendServiceName,
- @BinderParam(BindToJsonPayload.class) BackendServiceOptions backendServiceOptions);
-
- /**
- * Updates the specified backend service resource, with patch semantics, with
- * the data included in the request.
- *
- * @param backendServiceName the name backend service to be updated.
- * @param backendServiceOptions the new backend service.
- * @return an Operation resource. To check on the status of an operation,
- * poll the Operations resource returned to you, and look for the
- * status field.
- */
- @Named("BackendServices:patch")
- @PATCH
- @Produces(APPLICATION_JSON)
- @Path("/{backendService}")
- Operation patch(@PathParam("backendService") String backendServiceName,
- @BinderParam(BindToJsonPayload.class) BackendServiceOptions backendServiceOptions);
-
- /**
- * Gets the most recent health check results for this backend service. Note
- * that health check results will only be returned if the backend service has
- * a valid global forwarding rule referencing it.
- *
- * @param backendServiceName the name backend service to get health stats on.
- * @param group the group in the backend service to get health stats on.
- * @return a BackendServiceGroupHealth resource denoting the health states of
- * instances in the specified group.
- */
- @Named("BackendServices:getHealth")
- @POST
- @Produces(APPLICATION_JSON)
- @Path("/{backendService}/getHealth")
- @MapBinder(BindToJsonPayload.class)
- HealthStatus getHealth(@PathParam("backendService") String backendServiceName,
- @PayloadParam("group") URI group);
-
- /**
- * Deletes the specified backend service resource.
- *
- * @param backendServiceName name of the backend service resource to delete.
- * @return an Operation resource. To check on the status of an operation,
- * poll the Operations resource returned to you, and look for the
- * status field.
- */
- @Named("BackendServices:delete")
- @DELETE
- @Path("/{backendService}")
- @Fallback(NullOnNotFoundOr404.class)
- Operation delete(@PathParam("backendService") String backendServiceName);
-
- /**
- * Retrieves the list of backend service resources available to the specified
- * project. By default the list as a maximum size of 100, if no options are
- * provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("BackendServices:list")
- @GET
- ListPage<BackendService> listPage(@QueryParam("pageToken") @Nullable String pageToken, ListOptions options);
-
- /** @see #listPage(String, ListOptions) */
- @Named("BackendServices:list")
- @GET
- @Transform(BackendServicePages.class)
- Iterator<ListPage<BackendService>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("BackendServices:list")
- @GET
- @Transform(BackendServicePages.class)
- Iterator<ListPage<BackendService>> list(ListOptions options);
-
- static final class BackendServicePages extends BaseToIteratorOfListPage<BackendService, BackendServicePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject BackendServicePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<BackendService>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<BackendService>>() {
- @Override public ListPage<BackendService> apply(String pageToken) {
- return api.backendServices().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java
deleted file mode 100644
index ce826d0..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.binders.DiskCreationBinder;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/disks")
-@Consumes(APPLICATION_JSON)
-public interface DiskApi {
-
- /** Returns a persistent disk by name or null if not found. */
- @Named("Disks:get")
- @GET
- @Path("/{disk}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Disk get(@PathParam("disk") String disk);
-
- /**
- * Creates a persistent disk resource, in the specified project, specifying the size of the disk and other options.
- *
- * @param diskName the name of disk.
- * @param sizeGb the size of the disk
- * @param options the options of the disk to create.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Disks:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(DiskCreationBinder.class)
- Operation create(@PayloadParam("name") String diskName,
- @PayloadParam("options") DiskCreationOptions options);
-
- /**
- * Creates a persistent disk resource, in the specified project, specifying the size of the disk and other options.
- *
- * @param diskName the name of disk.
- * @param sourceImage Fully-qualified URL of the source image to apply to the disk.
- * @param options the options of the disk to create.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Disks:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(DiskCreationBinder.class)
- Operation create(@PayloadParam("name") String diskName,
- @QueryParam("sourceImage") String sourceImage,
- @PayloadParam("options") DiskCreationOptions options);
-
- /** Deletes a persistent disk by name and returns the operation in progress, or null if not found. */
- @Named("Disks:delete")
- @DELETE
- @Path("/{disk}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("disk") String disk);
-
- /**
- * Create a snapshot of a given disk in a zone.
- *
- * @param diskName the name of the disk.
- * @param snapshotName the name for the snapshot to be created.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Disks:createSnapshot")
- @POST
- @Path("/{disk}/createSnapshot")
- @MapBinder(BindToJsonPayload.class)
- Operation createSnapshot(@PathParam("disk") String diskName, @PayloadParam("name") String snapshotName);
-
- /** @see #createSnapshot(String, String) */
- @Named("Disks:createSnapshot")
- @POST
- @Path("/{disk}/createSnapshot")
- @MapBinder(BindToJsonPayload.class)
- Operation createSnapshot(@PathParam("disk") String diskName, @PayloadParam("name") String snapshotName,
- @PayloadParam("description") String description);
-
- /**
- * Retrieves the list of persistent disk resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Disks:list")
- @GET
- ListPage<Disk> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Disks:list")
- @GET
- @Transform(DiskPages.class)
- Iterator<ListPage<Disk>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Disks:list")
- @GET
- @Transform(DiskPages.class)
- Iterator<ListPage<Disk>> list(ListOptions options);
-
- static final class DiskPages extends BaseCallerArg0ToIteratorOfListPage<Disk, DiskPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject DiskPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Disk>> fetchNextPage(final String zoneName, final ListOptions options) {
- return new Function<String, ListPage<Disk>>() {
- @Override public ListPage<Disk> apply(String pageToken) {
- return api.disksInZone(zoneName).listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java
deleted file mode 100644
index c4a6d60..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskTypeApi.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/diskTypes")
-@Consumes(APPLICATION_JSON)
-public interface DiskTypeApi {
-
- /** Returns a disk type by name or null if not found. */
- @Named("DiskTypes:get")
- @GET
- @Path("/{diskType}")
- @Fallback(NullOnNotFoundOr404.class)
- DiskType get(@PathParam("diskType") String diskType);
-
- /**
- * Retrieves the list of disk type resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("DiskTypes:list")
- @GET
- ListPage<DiskType> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("DiskTypes:list")
- @GET
- @Transform(DiskTypePages.class)
- Iterator<ListPage<DiskType>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("DiskTypes:list")
- @GET
- @Transform(DiskTypePages.class)
- Iterator<ListPage<DiskType>> list(ListOptions options);
-
- static final class DiskTypePages extends BaseCallerArg0ToIteratorOfListPage<DiskType, DiskTypePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject DiskTypePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<DiskType>> fetchNextPage(final String zoneName, final ListOptions options) {
- return new Function<String, ListPage<DiskType>>() {
- @Override public ListPage<DiskType> apply(String pageToken) {
- return api.diskTypesInZone(zoneName).listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java
deleted file mode 100644
index 6627d53..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.binders.FirewallBinder;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PATCH;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/firewalls")
-@Consumes(APPLICATION_JSON)
-public interface FirewallApi {
-
- /** Returns a firewall by name or null if not found. */
- @Named("Firewalls:get")
- @GET
- @Path("/{firewall}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Firewall get(@PathParam("firewall") String firewall);
-
- /**
- * Creates a firewall resource in the specified project using the data included in the request.
- *
- * @param name the name of the firewall to be inserted.
- * @param network the network to which to add the firewall
- * @param firewallOptions the options of the firewall to add
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Firewalls:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(FirewallBinder.class)
- Operation createInNetwork(@PayloadParam("name") String name,
- @PayloadParam("network") URI network,
- @PayloadParam("options") FirewallOptions firewallOptions);
-
- /**
- * Updates the specified firewall resource with the data included in the request.
- *
- * @param firewall the name firewall to be updated.
- * @param firewallOptions the new firewall.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Firewalls:update")
- @PUT
- @Produces(APPLICATION_JSON)
- @Path("/{firewall}")
- Operation update(@PathParam("firewall") String firewall,
- @BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions);
-
- /**
- * Updates the specified firewall resource, with patch semantics, with the data included in the request.
- *
- * @param firewall the name firewall to be updated.
- * @param firewallOptions the new firewall.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Firewalls:patch")
- @PATCH
- @Produces(APPLICATION_JSON)
- @Path("/{firewall}")
- Operation patch(@PathParam("firewall") String firewall,
- @BinderParam(BindToJsonPayload.class) FirewallOptions firewallOptions);
-
- /** Deletes a firewall by name and returns the operation in progress, or null if not found. */
- @Named("Firewalls:delete")
- @DELETE
- @Path("/{firewall}")
- @Fallback(NullOnNotFoundOr404.class)
- Operation delete(@PathParam("firewall") String firewall);
-
- /**
- * Retrieves the list of firewall resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Firewalls:list")
- @GET
- ListPage<Firewall> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Firewalls:list")
- @GET
- @Transform(FirewallPages.class)
- Iterator<ListPage<Firewall>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Firewalls:list")
- @GET
- @Transform(FirewallPages.class)
- Iterator<ListPage<Firewall>> list(ListOptions options);
-
- static final class FirewallPages extends BaseToIteratorOfListPage<Firewall, FirewallPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject FirewallPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Firewall>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Firewall>>() {
- @Override public ListPage<Firewall> apply(String pageToken) {
- return api.firewalls().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java
deleted file mode 100644
index 220dbdc..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApi.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.binders.ForwardingRuleCreationBinder;
-
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/forwardingRules")
-@Consumes(APPLICATION_JSON)
-public interface ForwardingRuleApi {
-
- /** Returns a forwarding rule by name or null if not found. */
- @Named("ForwardingRules:get")
- @GET
- @Path("/{forwardingRule}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- ForwardingRule get(@PathParam("forwardingRule") String forwardingRule);
-
- /**
- * Creates a ForwardingRule resource in the specified project and region using the data included in the request.
- *
- * @param forwardingRuleName the name of the forwarding rule.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("ForwardingRules:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(ForwardingRuleCreationBinder.class)
- Operation create(@PayloadParam("name") String forwardingRuleName,
- @PayloadParam("options") ForwardingRuleCreationOptions options);
-
-
- /** Deletes a forwarding rule by name and returns the operation in progress, or null if not found. */
- @Named("ForwardingRules:delete")
- @DELETE
- @Path("/{forwardingRule}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("forwardingRule") String forwardingRule);
-
- /**
- * Changes the target url for a forwarding rule.
- *
- * @param forwardingRule the name of the ForwardingRule resource in which target is to be set.
- * @param target The URL of the target resource to receive traffic from this forwarding rule.
- * It must live in the same region as this forwarding rule.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("ForwardingRules:setTarget")
- @POST
- @Path("/{forwardingRule}/setTarget")
- @Fallback(NullOnNotFoundOr404.class)
- @MapBinder(BindToJsonPayload.class)
- @Nullable
- Operation setTarget(@PathParam("forwardingRule") String forwardingRule, @PayloadParam("target") URI target);
-
- /**
- * Retrieves the list of forwarding rule resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("ForwardingRules:list")
- @GET
- ListPage<ForwardingRule> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("ForwardingRules:list")
- @GET
- @Transform(ForwardingRulePages.class)
- Iterator<ListPage<ForwardingRule>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("ForwardingRules:list")
- @GET
- @Transform(ForwardingRulePages.class)
- Iterator<ListPage<ForwardingRule>> list(ListOptions options);
-
- static final class ForwardingRulePages
- extends BaseCallerArg0ToIteratorOfListPage<ForwardingRule, ForwardingRulePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject ForwardingRulePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<ForwardingRule>> fetchNextPage(final String regionName,
- final ListOptions options) {
- return new Function<String, ListPage<ForwardingRule>>() {
- @Override public ListPage<ForwardingRule> apply(String pageToken) {
- return api.forwardingRulesInRegion(regionName).listPage(pageToken, options);
- }
- };
- }
- }
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java
deleted file mode 100644
index 17be678..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApi.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.binders.HttpHealthCheckCreationBinder;
-import org.jclouds.googlecomputeengine.domain.HttpHealthCheck;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PATCH;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/httpHealthChecks")
-@Consumes(APPLICATION_JSON)
-public interface HttpHealthCheckApi {
-
- /** Returns a health check by name or null if not found. */
- @Named("HttpHealthChecks:get")
- @GET
- @Path("/{httpHealthCheck}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- HttpHealthCheck get(@PathParam("httpHealthCheck") String httpHealthCheck);
-
- /**
- * Creates a HttpHealthCheck resource in the specified project and region using the data included in the request.
- *
- * @param httpHealthCheckName the name of the forwarding rule.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("HttpHealthChecks:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation insert(@PayloadParam("name") String httpHealthCheckName);
-
- /**
- * Creates a HttpHealthCheck resource in the specified project and region using the data included in the request.
- *
- * @param name the name of the forwarding rule.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("HttpHealthChecks:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(HttpHealthCheckCreationBinder.class)
- Operation insert(@PayloadParam("name") String name, @PayloadParam("options") HttpHealthCheckCreationOptions options);
-
- /** Deletes a health check by name and returns the operation in progress, or null if not found. */
- @Named("HttpHealthChecks:delete")
- @DELETE
- @Path("/{httpHealthCheck}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("httpHealthCheck") String httpHealthCheck);
-
- /**
- * Updates a HttpHealthCheck resource in the specified project
- * using the data included in the request. This method supports patch semantics.
- *
- * @param name the name of the HttpHealthCheck resource to update.
- * @param options the options to set for the healthCheck
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("HttpHealthChecks:patch")
- @PATCH
- @Path("/{httpHealthCheck}")
- @MapBinder(HttpHealthCheckCreationBinder.class)
- @Nullable
- Operation patch(@PathParam("httpHealthCheck") @PayloadParam("name") String name,
- @PayloadParam("options") HttpHealthCheckCreationOptions options);
-
- /**
- * Updates a HttpHealthCheck resource in the specified project using the data included in the request.
- * Any options left blank will be overwritten!
- *
- * @param name the name of the forwarding rule.
- * @param options the options to set for the healthCheck
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("HttpHealthChecks:update")
- @PUT
- @Path("/{httpHealthCheck}")
- @Produces(APPLICATION_JSON)
- @MapBinder(HttpHealthCheckCreationBinder.class)
- Operation update(@PathParam("httpHealthCheck") @PayloadParam("name") String name,
- @PayloadParam("options") HttpHealthCheckCreationOptions options);
-
- /**
- * Retrieves the list of persistent http health check resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("HttpHealthChecks:list")
- @GET
- ListPage<HttpHealthCheck> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("HttpHealthChecks:list")
- @GET
- @Transform(HttpHealthCheckPages.class)
- Iterator<ListPage<HttpHealthCheck>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("HttpHealthChecks:list")
- @GET
- @Transform(HttpHealthCheckPages.class)
- Iterator<ListPage<HttpHealthCheck>> list(ListOptions options);
-
- static final class HttpHealthCheckPages extends BaseToIteratorOfListPage<HttpHealthCheck, HttpHealthCheckPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject HttpHealthCheckPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<HttpHealthCheck>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<HttpHealthCheck>>() {
- @Override public ListPage<HttpHealthCheck> apply(String pageToken) {
- return api.httpHeathChecks().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java
deleted file mode 100644
index 58d206e..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.config.CurrentProject;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.DeprecateOptions;
-import org.jclouds.googlecomputeengine.options.ImageCreationOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Endpoint;
-import org.jclouds.rest.annotations.EndpointParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface ImageApi {
-
- /** Returns an image by self-link or null if not found. */
- @Named("Images:get")
- @GET
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Image get(@EndpointParam URI selfLink);
-
- /** Returns an image by name or null if not found. */
- @Named("Images:get ")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/images/{image}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Image get(@PathParam("image") String image);
-
- /** Deletes an image by name and returns the operation in progress, or null if not found. */
- @Named("Images:delete")
- @DELETE
- @Endpoint(CurrentProject.class)
- @Path("/global/images/{image}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("image") String image);
-
- /**
- * Creates an image resource in the specified project from the provided persistent disk.
- *
- * @param image the name of the created image
- * @param sourceDisk fully qualified URL for the persistent disk to create the image from
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Images:insert")
- @POST
- @Endpoint(CurrentProject.class)
- @Path("/global/images")
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation createFromDisk(@PayloadParam("name") String image, @PayloadParam("sourceDisk") String sourceDisk);
-
- @Named("Images:insert")
- @POST
- @Endpoint(CurrentProject.class)
- @Path("/global/images")
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) ImageCreationOptions options);
-
- /**
- * Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead.
- *
- * @param image The Image resource to deprecate.
- * @param deprecated the deprecation status to return
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Images:deprecate")
- @POST
- @Endpoint(CurrentProject.class)
- @Path("/global/images/{image}/deprecate")
- Operation deprecate(@PathParam("image") String image, @BinderParam(BindToJsonPayload.class) DeprecateOptions deprecated);
-
- /**
- * Retrieves the list of image resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Images:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/images")
- ListPage<Image> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Images:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/images")
- @Transform(ImagePages.class)
- Iterator<ListPage<Image>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Images:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/images")
- @Transform(ImagePages.class)
- Iterator<ListPage<Image>> list(ListOptions options);
-
- static final class ImagePages extends BaseToIteratorOfListPage<Image, ImagePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject ImagePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Image>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Image>>() {
- @Override public ListPage<Image> apply(String pageToken) {
- return api.images().listPage(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of image resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Images:list")
- @GET
- @Path("/projects/{project}/global/images")
- ListPage<Image> listPageInProject(@PathParam("project") String projectName,
- @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /**
- * @see #listPageInProject(String, String, ListOptions)
- */
- @Named("Images:list")
- @GET
- @Path("/projects/{project}/global/images")
- @Transform(ImagePagesInProject.class)
- Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName);
-
- /**
- * @see #listPageInProject(String, String, ListOptions)
- */
- @Named("Images:list")
- @GET
- @Path("/projects/{project}/global/images")
- @Transform(ImagePagesInProject.class)
- Iterator<ListPage<Image>> listInProject(@PathParam("project") String projectName, ListOptions options);
-
- static final class ImagePagesInProject extends BaseArg0ToIteratorOfListPage<Image, ImagePagesInProject> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject ImagePagesInProject(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Image>> fetchNextPage(final String projectName, final ListOptions options) {
- return new Function<String, ListPage<Image>>() {
- @Override public ListPage<Image> apply(String pageToken) {
- return api.images().listPageInProject(projectName, pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java
deleted file mode 100644
index 5405de2..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig;
-import static org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.AttachDisk;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling;
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.NewInstance;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/instances")
-@Consumes(APPLICATION_JSON)
-public interface InstanceApi {
-
- /** Returns an instance by name or null if not found. */
- @Named("Instances:get")
- @GET
- @Path("/{instance}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Instance get(@PathParam("instance") String instance);
-
- /**
- * Creates a instance resource in the specified project using the data included in the request.
- *
- * @param template the instance template
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Instances:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) NewInstance template);
-
- /** Deletes an instance by name and returns the operation in progress, or null if not found. */
- @Named("Instances:delete")
- @DELETE
- @Path("/{instance}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("instance") String instance);
-
- /**
- * Adds an access config to an instance's network interface.
- *
- * @param instance the instance name.
- * @param accessConfig the AccessConfig to add.
- * @param networkInterfaceName network interface name.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Instances:addAccessConfig")
- @POST
- @Produces(APPLICATION_JSON)
- @Path("/{instance}/addAccessConfig")
- Operation addAccessConfigToNic(@PathParam("instance") String instance,
- @BinderParam(BindToJsonPayload.class)
- AccessConfig accessConfig,
- @QueryParam("networkInterface") String networkInterfaceName);
-
- /**
- * Deletes an access config from an instance's network interface.
- *
- * @param instance the instance name.
- * @param accessConfigName the name of the access config to delete
- * @param networkInterfaceName network interface name.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Instances:deleteAccessConfig")
- @POST
- @Path("/{instance}/deleteAccessConfig")
- Operation deleteAccessConfigFromNic(@PathParam("instance") String instance,
- @QueryParam("accessConfig") String accessConfigName,
- @QueryParam("networkInterface") String networkInterfaceName);
-
- /**
- * Returns the specified instance's serial port output.
- *
- * @param instance the instance name.
- * @return if successful, this method returns a SerialPortOutput containing the instance's serial output.
- */
- @Named("Instances:getSerialPortOutput")
- @GET
- @Path("/{instance}/serialPort")
- SerialPortOutput getSerialPortOutput(@PathParam("instance") String instance);
-
- /**
- * Hard-resets the instance.
- *
- * @param instance the instance name
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Instances:reset")
- @POST
- @Path("/{instance}/reset")
- Operation reset(@PathParam("instance") String instance);
-
- /**
- * Attaches a disk to an instance
- *
- * @param instance The instance name to attach to
- * @param attachDiskOptions The options for attaching the disk.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Instances:attachDisk")
- @POST
- @Produces(APPLICATION_JSON)
- @Path("/{instance}/attachDisk")
- Operation attachDisk(@PathParam("instance") String instance,
- @BinderParam(BindToJsonPayload.class) AttachDisk attachDiskOptions);
-
- /**
- * Detaches an attached disk from an instance
- *
- * @param instance The instance name to attach to
- * @param deviceName The device name of the disk to detach.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Instances:detachDisk")
- @POST
- @Path("/{instance}/detachDisk")
- Operation detachDisk(@PathParam("instance") String instance, @QueryParam("deviceName") String deviceName);
-
- /**
- * Sets metadata for an instance using the data included in the request.
- * <p/>
- * NOTE: This *sets* metadata items on the project (vs *adding* items to metadata),
- * if there are existing metadata that must be kept these must be fetched first and then re-sent on update.
- * <pre><tt>
- * Metadata update = instanceApi.get("myInstance").metadata().clone();
- * update.put("newItem","newItemValue");
- * instanceApi.setMetadata("myInstance", update);
- * </tt></pre>
- *
- * @param instance The name of the instance
- * @param metadata the metadata to set
- *
- * @return an Operations resource. To check on the status of an operation, poll the Operations resource returned
- * to you, and look for the status field.
- */
- @Named("Instances:setMetadata")
- @POST
- @Path("/{instance}/setMetadata")
- Operation setMetadata(@PathParam("instance") String instance,
- @BinderParam(BindToJsonPayload.class) Metadata metadata);
-
- /**
- * Lists items for an instance
- *
- * @param instance the name of the instance
- * @param items A set of items
- * @param fingerprint The current fingerprint for the items
- * @return an Operations resource. To check on the status of an operation, poll the Operations resource returned
- * to you, and look for the status field.
- */
- @Named("Instances:setTags")
- @POST
- @Path("/{instance}/setTags")
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation setTags(@PathParam("instance") String instance,
- @PayloadParam("items") Iterable<String> items,
- @PayloadParam("fingerprint") String fingerprint);
-
- /**
- * Sets the auto-delete flag for a disk attached to an instance
- *
- * @param instanceName The name of the instance
- * @param deviceName Disk device name to modify.
- * @param autoDelete Whether to auto-delete the disk when the instance is deleted
- */
- @Named("Instances:setDiskAutoDelete")
- @POST
- @Path("/{instance}/setDiskAutoDelete")
- Operation setDiskAutoDelete(@PathParam("instance") String instanceName,
- @QueryParam("deviceName") String deviceName,
- @QueryParam("autoDelete") boolean autoDelete);
-
- /**
- * Sets an instance's scheduling options.
- * @see <a href = "https://cloud.google.com/compute/docs/instances#onhostmaintenance"/>
- *
- * @param instanceName The name of the instance
- * @param onHostMaintenance either MIGRATE or TERMINATE the default is MIGRATE (Live Migration).
- * @param automaticRestart Defines whether the Instance should be automatically
- * restarted when it is terminated by Compute Engine (not terminated by user).
- * Used when onHostMaintenance is set to TERMINATE.
- * @return
- */
- @Named("Instances:setScheduling")
- @POST
- @Path("/{instance}/setScheduling")
- @MapBinder(BindToJsonPayload.class)
- Operation setScheduling(@PathParam("instance") String instanceName,
- @PayloadParam("onHostMaintenance") Scheduling.OnHostMaintenance onHostMaintenance,
- @PayloadParam("automaticRestart") boolean automaticRestart);
-
- /**
- * This method starts an instance that was stopped using the using the {@link #stop(String)} method.
- * @param instance - name of the instance to be started
- */
- @Named("Instances:start")
- @POST
- @Path("/{instance}/start")
- @Produces(APPLICATION_JSON)
- Operation start(@PathParam("instance") String instance);
-
- /**
- * This method stops a running instance, shutting it down cleanly, and allows you to restart
- * the instance at a later time. Stopped instances do not incur per-minute, virtual machine
- * usage charges while they are stopped, but any resources that the virtual machine is using,
- * such as persistent disks and static IP addresses,will continue to be charged until they are deleted.
- * @param instance
- * @return
- */
- @Named("Instances:stop")
- @POST
- @Path("/{instance}/stop")
- @Produces(APPLICATION_JSON)
- Operation stop(@PathParam("instance") String instance);
-
- /**
- * Retrieves the list of instance resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Instances:list")
- @GET
- ListPage<Instance> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Instances:list")
- @GET
- @Transform(InstancePages.class)
- Iterator<ListPage<Instance>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Instances:list")
- @GET
- @Transform(InstancePages.class)
- Iterator<ListPage<Instance>> list(ListOptions options);
-
- static final class InstancePages extends BaseCallerArg0ToIteratorOfListPage<Instance, InstancePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject InstancePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Instance>> fetchNextPage(final String zoneName, final ListOptions options) {
- return new Function<String, ListPage<Instance>>() {
- @Override public ListPage<Instance> apply(String pageToken) {
- return api.instancesInZone(zoneName).listPage(pageToken, options);
- }
- };
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/LicenseApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/LicenseApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/LicenseApi.java
deleted file mode 100644
index 9301fc5..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/LicenseApi.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.domain.License;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface LicenseApi {
-
- /** Returns the specified License resource. */
- @Named("License:get")
- @GET
- @Path("/licenses/{license}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- License get(@PathParam("license") String license);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java
deleted file mode 100644
index 7515ad1..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/machineTypes")
-@Consumes(APPLICATION_JSON)
-public interface MachineTypeApi {
-
- /** Returns an machine type by name or null if not found. */
- @Named("MachineTypes:get")
- @GET
- @Path("/{machineType}")
- @Fallback(NullOnNotFoundOr404.class)
- MachineType get(@PathParam("machineType") String machineType);
-
- /**
- * Retrieves the list of machine type resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("MachineTypes:list")
- @GET
- ListPage<MachineType> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("MachineTypes:list")
- @GET
- @Transform(MachineTypePages.class)
- Iterator<ListPage<MachineType>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("MachineTypes:list")
- @GET
- @Transform(MachineTypePages.class)
- Iterator<ListPage<MachineType>> list(ListOptions options);
-
- static final class MachineTypePages extends BaseCallerArg0ToIteratorOfListPage<MachineType, MachineTypePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject MachineTypePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<MachineType>> fetchNextPage(final String zoneName, final ListOptions options) {
- return new Function<String, ListPage<MachineType>>() {
- @Override public ListPage<MachineType> apply(String pageToken) {
- return api.machineTypesInZone(zoneName).listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java
deleted file mode 100644
index c975784..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.googlecomputeengine.options.NetworkCreationOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/networks")
-@Consumes(APPLICATION_JSON)
-public interface NetworkApi {
-
- /** Returns a network by name or null if not found. */
- @Named("Networks:get")
- @GET
- @Path("/{network}")
- @Fallback(NullOnNotFoundOr404.class)
- Network get(@PathParam("network") String networkName);
-
- /**
- * Creates a persistent network resource in the specified project with the specified range.
- *
- * @param networkName the network name
- * @param IPv4Range the range of the network to be inserted.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Networks:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation createInIPv4Range(@PayloadParam("name") String networkName,
- @PayloadParam("IPv4Range") String IPv4Range);
-
- /**
- * Creates a persistent network resource in the specified project with the specified range and specified gateway.
- *
- * @param networkName the network name
- * @param IPv4Range the range of the network to be inserted.
- * @param gatewayIPv4 the range of the network to be inserted.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Networks:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation createInIPv4Range(@BinderParam(BindToJsonPayload.class) NetworkCreationOptions options);
-
- /** Deletes a network by name and returns the operation in progress, or null if not found. */
- @Named("Networks:delete")
- @DELETE
- @Path("/{network}")
- @Fallback(NullOnNotFoundOr404.class)
- Operation delete(@PathParam("network") String networkName);
-
- /**
- * Retrieves the list of network resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Networks:list")
- @GET
- ListPage<Network> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Networks:list")
- @GET
- @Transform(NetworkPages.class)
- Iterator<ListPage<Network>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Networks:list")
- @GET
- @Transform(NetworkPages.class)
- Iterator<ListPage<Network>> list(ListOptions options);
-
- static final class NetworkPages extends BaseToIteratorOfListPage<Network, NetworkPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject NetworkPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Network>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Network>>() {
- @Override public ListPage<Network> apply(String pageToken) {
- return api.networks().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java
deleted file mode 100644
index c6ceb2d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/OperationApi.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.config.CurrentProject;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Endpoint;
-import org.jclouds.rest.annotations.EndpointParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface OperationApi {
-
- /** Returns an operation by self-link or null if not found. */
- @Named("Operations:get")
- @GET
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation get(@EndpointParam URI operation);
-
- /** Deletes an operation by name. */
- @Named("Operations:delete")
- @DELETE
- @Fallback(VoidOnNotFoundOr404.class)
- void delete(@EndpointParam URI operation);
-
- /**
- * Retrieves the list of operation resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("GlobalOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/operations")
- ListPage<Operation> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("GlobalOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/operations")
- @Transform(OperationPages.class)
- Iterator<ListPage<Operation>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("GlobalOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/global/operations")
- @Transform(OperationPages.class)
- Iterator<ListPage<Operation>> list(ListOptions options);
-
- static final class OperationPages extends BaseToIteratorOfListPage<Operation, OperationPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject OperationPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Operation>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Operation>>() {
- @Override public ListPage<Operation> apply(String pageToken) {
- return api.operations().listPage(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of operation resources available in the specified region.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("RegionOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/regions/{region}/operations")
- ListPage<Operation> listPageInRegion(@PathParam("region") String region,
- @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listInRegion(String, org.jclouds.googlecomputeengine.options.ListOptions) */
- @Named("RegionOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/regions/{region}/operations")
- @Transform(OperationPagesInRegion.class)
- Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region);
-
- /** @see #listInRegion(String, org.jclouds.googlecomputeengine.options.ListOptions) */
- @Named("RegionOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/regions/{region}/operations")
- @Transform(OperationPagesInRegion.class)
- Iterator<ListPage<Operation>> listInRegion(@PathParam("region") String region, ListOptions options);
-
- static final class OperationPagesInRegion extends BaseArg0ToIteratorOfListPage<Operation, OperationPagesInRegion> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject OperationPagesInRegion(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Operation>> fetchNextPage(final String regionName,
- final ListOptions options) {
- return new Function<String, ListPage<Operation>>() {
- @Override public ListPage<Operation> apply(String pageToken) {
- return api.operations().listPageInRegion(regionName, pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of operation resources available in the specified zone.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("ZoneOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}/operations")
- ListPage<Operation> listPageInZone(@PathParam("zone") String zone,
- @Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listInZone(String, org.jclouds.googlecomputeengine.options.ListOptions) */
- @Named("ZoneOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}/operations")
- @Transform(OperationPagesInZone.class)
- Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone);
-
- /** @see #listInZone(String, org.jclouds.googlecomputeengine.options.ListOptions) */
- @Named("ZoneOperations:list")
- @GET
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}/operations")
- @Transform(OperationPagesInZone.class)
- Iterator<ListPage<Operation>> listInZone(@PathParam("zone") String zone, ListOptions options);
-
- static final class OperationPagesInZone extends BaseArg0ToIteratorOfListPage<Operation, OperationPagesInZone> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject OperationPagesInZone(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Operation>> fetchNextPage(final String zoneName, final ListOptions options) {
- return new Function<String, ListPage<Operation>>() {
- @Override public ListPage<Operation> apply(String pageToken) {
- return api.operations().listPageInZone(zoneName, pageToken, options);
- }
- };
- }
- }
-}
[05/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java
deleted file mode 100644
index 2d5977e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java
+++ /dev/null
@@ -1,98 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseMachineTypeListTest")
-public class ParseMachineTypeListTest extends BaseGoogleComputeEngineParseTest<ListPage<MachineType>> {
-
- @Override
- public String resource() {
- return "/machinetype_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<MachineType> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<MachineType> expected(String baseUrl) {
- MachineType machineType1 = MachineType.create( //
- "4618642685664990776", // id
- parse("2013-04-25T13:32:49.088-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/machineTypes/f1-micro"), // selfLink
- "f1-micro", // name
- "1 vCPU (shared physical core) and 0.6 GB RAM", // description
- 1, // guestCpus
- 614, // memoryMb
- null, // imageSpaceGb
- null, // scratchDisks
- 4, // maximumPersistentDisks
- 3072, // maximumPersistentDisksSizeGb
- "us-central1-a", // zone
- null // deprecated
- );
- MachineType machineType2 = MachineType.create( //
- "12907738072351752276", // id
- parse("2012-06-07T20:48:14.670"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/machineTypes/n1-standard-1"), // selfLink
- "n1-standard-1", // name
- "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", // description
- 1, // guestCpus
- 3840, // memoryMb
- null, // imageSpaceGb
- null, // scratchDisks
- 16, // maximumPersistentDisks
- 128, // maximumPersistentDisksSizeGb
- "us-central1-a", // zone
- null // deprecated
- );
- MachineType machineType3 = MachineType.create( //
- "12908560709887590691", // id
- parse("2012-06-07T20:51:19.936"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/machineTypes/n1-standard-8-d"), // selfLink
- "n1-standard-8-d", // name
- "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks", // description
- 8, // guestCpus
- 30720, // memoryMb
- null, // imageSpaceGb
- ImmutableList.of(MachineType.ScratchDisk.create(1770), MachineType.ScratchDisk.create(1770)), // scratchDisks
- 16, // maximumPersistentDisks
- 1024, // maximumPersistentDisksSizeGb
- "us-central1-a", // zone
- null // deprecated
- );
- return ForwardingListPage.create( //
- ImmutableList.of(machineType1, machineType2, machineType3), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeTest.java
deleted file mode 100644
index 893dcab..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.domain.MachineType.ScratchDisk;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseMachineTypeTest")
-public class ParseMachineTypeTest extends BaseGoogleComputeEngineParseTest<MachineType> {
-
- @Override
- public String resource() {
- return "/machinetype.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public MachineType expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public MachineType expected(String baseUrl) {
- return MachineType.create( //
- "12907738072351752276", // id
- parse("2012-06-07T20:48:14.670"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/machineTypes/n1-standard-1"), // selfLink
- "n1-standard-1", // name
- "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", // description
- 1, // guestCpus
- 3840, // memoryMb
- null, // imageSpaceGb
- ImmutableList.of(ScratchDisk.create(1770), ScratchDisk.create(1770)), // scratchDisks
- 16, // maximumPersistentDisks
- 128, // maximumPersistentDisksSizeGb
- "us-central1-a", // zone
- null // deprecated
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMetadataTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMetadataTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMetadataTest.java
deleted file mode 100644
index 3a43b9e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMetadataTest.java
+++ /dev/null
@@ -1,39 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseMetadataTest")
-public class ParseMetadataTest extends BaseGoogleComputeEngineParseTest<Metadata> {
-
- @Override
- public String resource() {
- return "/metadata.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Metadata expected() {
- return Metadata.create("efgh").put("propA", "valueA").put("propB", "valueB");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkListTest.java
deleted file mode 100644
index f6d92fa..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkListTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseNetworkListTest")
-public class ParseNetworkListTest extends BaseGoogleComputeEngineParseTest<ListPage<Network>> {
-
- @Override
- public String resource() {
- return "/network_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Network> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Network> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseNetworkTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java
deleted file mode 100644
index 98ad345..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java
+++ /dev/null
@@ -1,54 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseNetworkTest")
-public class ParseNetworkTest extends BaseGoogleComputeEngineParseTest<Network> {
-
- @Override
- public String resource() {
- return "/network_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Network expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Network expected(String baseUrl) {
- return Network.create( //
- "13024414170909937976", // id
- parse("2012-10-24T20:13:19.967"), // creationTimestamp
- URI.create(baseUrl + "/party/networks/jclouds-test"), // selfLink
- "jclouds-test", // name
- "A custom network for the project", // description
- "10.0.0.0/8", // rangeIPv4
- "10.0.0.1" // gatewayIPv4
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java
deleted file mode 100644
index 8d138a9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java
+++ /dev/null
@@ -1,79 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.KeyValuePair;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Warning;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseOperationTest")
-public class ParseOperationTest extends BaseGoogleComputeEngineParseTest<Operation> {
-
- @Override
- public String resource() {
- return "/operation.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Operation expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Operation expected(String baseUrl) {
- return Operation.create( //
- "13053095055850848306", // id
- parse("2013-07-26T13:57:20.204-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/operations/operation-1354084865060"),
- "operation-1354084865060", // name
- null, // description
- URI.create(baseUrl + "/party/zones/us-central1-a/instances/test-1"), // targetLink
- "13053094017547040099", // targetId
- null, // clientOperationId
- Operation.Status.DONE, // status
- null, // statusMessage
- "user@developer.gserviceaccount.com", // user
- 100, // progress
- parse("2012-11-28T06:41:05.060"), // insertTime
- parse("2012-11-28T06:41:05.142"), // startTime
- parse("2012-11-28T06:41:06.142"), // endTime
- 400, // httpErrorStatusCode
- "BAD REQUEST", // httpErrorMessage
- "insert", // operationType
- Operation.Error.create(ImmutableList.of(Operation.Error.Entry
- .create("INVALID_FIELD_VALUE", null,
- "Invalid value for field 'resource.urlMaps': "
- + "'projects/party/global/urlMaps/target-http-proxy-api-live-test-url-map-2'."
- + " Resource was not found."))), // errors
- ImmutableList.of(Warning.create("NO_RESULTS_ON_PAGE", "This is an example warning",
- ImmutableList.of(KeyValuePair
- .create("scope", "There are no results for scope 'zones/asia-east1-b' on this page.")))), // warnings
- URI.create(baseUrl + "/party/regions/us-central1"), // region
- URI.create(baseUrl + "/party/zones/us-central1-a") // zone
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseProjectTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseProjectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseProjectTest.java
deleted file mode 100644
index fcc3e00..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseProjectTest.java
+++ /dev/null
@@ -1,71 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.Project;
-import org.jclouds.googlecomputeengine.domain.Quota;
-import org.jclouds.googlecomputeengine.domain.Project.UsageExportLocation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseProjectTest")
-public class ParseProjectTest extends BaseGoogleComputeEngineParseTest<Project> {
-
- @Override
- public String resource() {
- return "/project.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Project expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Project expected(String baseUrl) {
- return Project.create( //
- "13024414184846275913", // id
- URI.create(baseUrl + "/761326798069"), // selfLink
- "party", // name
- "", // description
- Metadata.create("efgh").put("propA", "valueA").put("propB", "valueB"), // commonInstanceMetadata
- ImmutableList.of( //
- Quota.create("INSTANCES", 0, 8), //
- Quota.create("CPUS", 0, 8), //
- Quota.create("EPHEMERAL_ADDRESSES", 0, 8), //
- Quota.create("DISKS", 0, 8), //
- Quota.create("DISKS_TOTAL_GB", 0, 100), //
- Quota.create("SNAPSHOTS", 0, 1000), //
- Quota.create("NETWORKS", 1, 5), //
- Quota.create("FIREWALLS", 2, 100), //
- Quota.create("IMAGES", 0, 100)), // quotas
- null, // externalIpAddresses
- new SimpleDateFormatDateService().iso8601DateParse("2012-10-24T20:13:16.252"), // creationTimestamp
- UsageExportLocation.create("test-bucket", "report-prefix")// usageExportLocation
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseQuotaTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseQuotaTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseQuotaTest.java
deleted file mode 100644
index 31c563b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseQuotaTest.java
+++ /dev/null
@@ -1,39 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Quota;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseQuotaTest")
-public class ParseQuotaTest extends BaseGoogleComputeEngineParseTest<Quota> {
-
- @Override
- public String resource() {
- return "/quota.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Quota expected() {
- return Quota.create("INSTANCES", 0.0, 8.0);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java
deleted file mode 100644
index 61f96b3..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java
+++ /dev/null
@@ -1,74 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Quota;
-import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseRegionListTest")
-public class ParseRegionListTest extends BaseGoogleComputeEngineParseTest<ListPage<Region>> {
-
- @Override
- public String resource() {
- return "/region_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Region> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Region> expected(String baseUrl) {
- Region region1 = new ParseRegionTest().expected(baseUrl);
- Region region2 = Region.create( //
- "6396763663251190992", // id
- parse("2013-07-08T14:40:37.939-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/regions/us-central2"), // selfLink
- "us-central2", // name
- "us-central2", // description
- Region.Status.UP, // status
- ImmutableList.of(URI.create(baseUrl + "/party/zones/us-central2-a")), // zones
- ImmutableList.of( //
- Quota.create("INSTANCES", 0, 8), //
- Quota.create("CPUS", 0, 8), //
- Quota.create("EPHEMERAL_ADDRESSES", 0, 8), //
- Quota.create("DISKS", 0, 8), //
- Quota.create("DISKS_TOTAL_GB", 0, 100), //
- Quota.create("SNAPSHOTS", 0, 1000), //
- Quota.create("NETWORKS", 1, 5), //
- Quota.create("FIREWALLS", 2, 100), //
- Quota.create("IMAGES", 0, 100)) // quotas
- );
- return ForwardingListPage.create( //
- ImmutableList.of(region1, region2), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionOperationTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionOperationTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionOperationTest.java
deleted file mode 100644
index 77dcfe9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionOperationTest.java
+++ /dev/null
@@ -1,69 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseRegionOperationTest")
-public class ParseRegionOperationTest extends BaseGoogleComputeEngineParseTest<Operation> {
-
- @Override
- public String resource() {
- return "/region_operation.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Operation expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Operation expected(String baseUrl) {
- return Operation.create( //
- "13053095055850848306", // id
- parse("2013-07-26T13:57:20.204-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/regions/us-central1/operations/operation-1354084865060"), // selfLink
- "operation-1354084865060", // name
- null, // description
- URI.create(baseUrl + "/party/regions/us-central1/addresses/test-address"), // targetLink
- "13053094017547040099", // targetId
- null, // clientOperationId
- Operation.Status.DONE, // status
- null, // statusMessage
- "user@developer.gserviceaccount.com", // user
- 100, // progress
- parse("2012-11-28T06:41:05.060"), // insertTime
- parse("2012-11-28T06:41:05.142"), // startTime
- parse("2012-11-28T06:41:06.142"), // endTime
- null, // httpErrorStatusCode
- null, // httpErrorMessage
- "insert", // operationType
- null, // errors
- null, // warnings
- URI.create(baseUrl + "/party/regions/us-central1"), // region
- null // zone
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionTest.java
deleted file mode 100644
index 611c794..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionTest.java
+++ /dev/null
@@ -1,69 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Quota;
-import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseRegionTest")
-public class ParseRegionTest extends BaseGoogleComputeEngineParseTest<Region> {
-
- @Override
- public String resource() {
- return "/region_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Region expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Region expected(String baseUrl) {
- return Region.create( //
- "12912210600542709766", // id
- parse("2013-07-08T14:40:37.939-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/regions/us-central1"), // selfLink
- "us-central1", // name
- "us-central1", // description
- Region.Status.UP, // status
- ImmutableList.of(//
- URI.create(baseUrl + "/party/zones/us-central1-a"),
- URI.create(baseUrl + "/party/zones/us-central1-b")), // zones
- ImmutableList.of( //
- Quota.create("INSTANCES", 0, 8), //
- Quota.create("CPUS", 0, 8), //
- Quota.create("EPHEMERAL_ADDRESSES", 0, 8), //
- Quota.create("DISKS", 0, 8), //
- Quota.create("DISKS_TOTAL_GB", 0, 100), //
- Quota.create("SNAPSHOTS", 0, 1000), //
- Quota.create("NETWORKS", 1, 5), //
- Quota.create("FIREWALLS", 2, 100), //
- Quota.create("IMAGES", 0, 100)) // quotas
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java
deleted file mode 100644
index e447e4e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java
+++ /dev/null
@@ -1,70 +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.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Route;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseRouteListTest")
-public class ParseRouteListTest extends BaseGoogleComputeEngineParseTest<ListPage<Route>> {
-
- @Override
- public String resource() {
- return "/route_list.json";
- }
-
- @Override @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<Route> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<Route> expected(String baseUrl) {
- Route route1 = new ParseRouteTest().expected(baseUrl);
- Route route2 = Route.create( //
- "507025480040058551", // id
- parse("2013-07-08T14:40:38.502-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/global/routes/default-route-fc92a41ecb5a8d17"), // selfLink
- "default-route-fc92a41ecb5a8d17", // name
- "Default route to the Internet.", // description
- URI.create(baseUrl + "/party/global/networks/default"), // network
- null, // tags
- "0.0.0.0/0", // destRange
- 1000, // priority
- null, // nextHopInstance
- null, // nextHopIp
- null, // nextHopNetwork
- URI.create(baseUrl + "/party/global/gateways/default-internet-gateway"), // nextHopGateway
- null, // warnings
- null // nextHopVpnTunnel
- );
- return ForwardingListPage.create( //
- ImmutableList.of(route1, route2), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java
deleted file mode 100644
index 4f952c1..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.KeyValuePair;
-import org.jclouds.googlecomputeengine.domain.Route;
-import org.jclouds.googlecomputeengine.domain.Warning;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseRouteTest")
-public class ParseRouteTest extends BaseGoogleComputeEngineParseTest<Route> {
-
- @Override
- public String resource() {
- return "/route_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Route expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Route expected(String baseUrl) {
- return Route.create( //
- "7241926205630356071", // id
- parse("2013-07-08T14:40:38.502-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/global/routes/default-route-c99ebfbed0e1f375"), // selfLink
- "default-route-c99ebfbed0e1f375", // name
- "Default route to the virtual network.", // description
- URI.create(baseUrl + "/party/global/networks/default"), // network
- ImmutableList.of("fooTag", "barTag"), // tags
- "10.240.0.0/16", // destRange
- 1000, // priority
- null, // nextHopInstance
- null, // nextHopIp
- URI.create(baseUrl + "/party/global/networks/default"), // nextHopNetwork
- null, // nextHopGateway
- ImmutableList.of(Warning.create("NO_RESULTS_ON_PAGE", "This is an example warning", ImmutableList.of(
- KeyValuePair.create("scope", "There are no results for scope 'zones/asia-east1-b' on this page.")))), // warnings
- null // nextHopVpnTunnel
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java
deleted file mode 100644
index b3c0f66..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java
+++ /dev/null
@@ -1,69 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Snapshot;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseSnapshotListTest")
-public class ParseSnapshotListTest extends BaseGoogleComputeEngineParseTest<ListPage<Snapshot>> {
-
- @Override
- public String resource() {
- return "/snapshot_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Snapshot> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Snapshot> expected(String baseUrl) {
- Snapshot snapshot1 = new ParseSnapshotTest().expected(baseUrl);
- Snapshot snapshot2 = Snapshot.create( //
- "13895715048576107883", // id
- URI.create(baseUrl + "/party/global/snapshots/test-snap2"), // selfLink
- parse("2013-07-26T12:57:01.927-07:00"), // creationTimestamp
- "test-snap2", // name
- "", // description
- 10, // sizeGb
- "READY", // status
- URI.create(baseUrl + "/party/zones/us-central1-a/disks/testimage1"), // sourceDisk
- "8243603669926824540", // sourceDiskId
- null, // storageBytes
- null, // storageByteStatus
- null // licenses
- );
- return ForwardingListPage.create( //
- ImmutableList.of(snapshot1, snapshot2), // items
- null // nextPageToken
- );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java
deleted file mode 100644
index 6f922c4..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Snapshot;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseSnapshotTest")
-public class ParseSnapshotTest extends BaseGoogleComputeEngineParseTest<Snapshot> {
-
- @Override
- public String resource() {
- return "/snapshot_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Snapshot expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Snapshot expected(String baseUrl) {
- return Snapshot.create( //
- "9734455566806191190", // id
- URI.create(baseUrl + "/party/global/snapshots/test-snap"), // selfLink
- parse("2013-07-26T12:54:23.173-07:00"), // creationTimestamp
- "test-snap", // name
- "", // description
- 10, // sizeGb
- "READY", // status
- URI.create(baseUrl + "/party/zones/us-central1-a/disks/testimage1"), // sourceDisk
- "8243603669926824540", // sourceDiskId
- null, // storageBytes
- null, // storageByteStatus
- null // licenses
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyListTest.java
deleted file mode 100644
index 4c0a3d2..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyListTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.TargetHttpProxy;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseTargetHttpProxyListTest extends BaseGoogleComputeEngineParseTest<ListPage<TargetHttpProxy>> {
-
- @Override
- public String resource() {
- return "/target_http_proxy_list.json";
- }
-
- @Override @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<TargetHttpProxy> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<TargetHttpProxy> expected(String baseUrl) {
- return ForwardingListPage.create(
- ImmutableList.of(
- new ParseTargetHttpProxyTest().expected(baseUrl),
- TargetHttpProxy.create("13050421646334304116", // id
- new SimpleDateFormatDateService().iso8601DateParse("2012-11-25T01:38:48.306"), // creationTimestamp
- URI.create(baseUrl + "/myproject/global/targetHttpProxies/jclouds-test-2"), // selfLink
- "jclouds-test-2", // name
- "Simple proxy", // description
- URI.create(baseUrl + "/myproject/global/urlMaps/jclouds-test-2"))), // urlMap
- null // nextPageToken d
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyTest.java
deleted file mode 100644
index 47ce80b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetHttpProxyTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.TargetHttpProxy;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit")
-public class ParseTargetHttpProxyTest extends BaseGoogleComputeEngineParseTest<TargetHttpProxy> {
-
- @Override
- public String resource() {
- return "/target_http_proxy_get.json";
- }
-
- @Override @Consumes(MediaType.APPLICATION_JSON)
- public TargetHttpProxy expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public TargetHttpProxy expected(String baseUrl) {
- return TargetHttpProxy.create("13050421646334304115", // id
- new SimpleDateFormatDateService().iso8601DateParse("2012-11-25T01:38:48.306"), // creationTimestamp
- URI.create(baseUrl + "/myproject/global/targetHttpProxies/jclouds-test"), // selfLink
- "jclouds-test", // name
- null,
- URI.create(baseUrl + "/myproject/global/urlMaps/jclouds-test")); // urlMap
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceListTest.java
deleted file mode 100644
index 694dd0b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceListTest.java
+++ /dev/null
@@ -1,62 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.TargetInstance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseTargetInstanceListTest")
-public class ParseTargetInstanceListTest extends BaseGoogleComputeEngineParseTest<ListPage<TargetInstance>> {
-
- @Override
- public String resource() {
- return "/target_instance_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<TargetInstance> expected() {
- return expected(BASE_URL);
- }
-
- public ListPage<TargetInstance> expected(String baseURL){
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseTargetInstanceTest().expected(baseURL),
- TargetInstance.create(
- "7362436693678237415", // id
- "2014-11-20T17:35:17.268-08:00", // creationTimestamp
- "target-instance-2", // name
- null, // description
- URI.create(baseURL + "/party/zones/us-central1-a"), // zone
- "NO_NAT", // natPolicy
- URI.create(baseURL + "/party/zones/us-central1-a/instances/test-3"), // instance
- URI.create(baseURL + "/party/zones/us-central1-a/targetInstances/target-instance-2") // selfLink
- )), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceTest.java
deleted file mode 100644
index ab78036..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetInstanceTest.java
+++ /dev/null
@@ -1,53 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.TargetInstance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseTargetInstanceTest")
-public class ParseTargetInstanceTest extends BaseGoogleComputeEngineParseTest<TargetInstance> {
-
- @Override
- public String resource() {
- return "/target_instance_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public TargetInstance expected() {
- return expected(BASE_URL);
- }
-
- public TargetInstance expected(String baseUrl) {
- return TargetInstance.create(
- "13050421646334304115", // id
- "2014-07-18T09:47:30.826-07:00", // creationTimestamp
- "target-instance-1", // name
- "A pretty cool target instance", // description
- URI.create(baseUrl + "/party/zones/us-central1-a"), // zone
- "NO_NAT", // natPolicy
- URI.create(baseUrl + "/party/zones/us-central1-a/instances/test-0"), // instance
- URI.create(baseUrl + "/party/zones/us-central1-a/targetInstances/target-instance-1")); //selfLink
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolListTest.java
deleted file mode 100644
index b53f805..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolListTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseTargetPoolListTest")
-public class ParseTargetPoolListTest extends BaseGoogleComputeEngineParseTest<ListPage<TargetPool>> {
-
- @Override
- public String resource() {
- return "/targetpool_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<TargetPool> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<TargetPool> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseTargetPoolTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolTest.java
deleted file mode 100644
index febd33c..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolTest.java
+++ /dev/null
@@ -1,58 +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.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions.SessionAffinityValue;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseTargetPoolTest")
-public class ParseTargetPoolTest extends BaseGoogleComputeEngineParseTest<TargetPool> {
-
- @Override
- public String resource() {
- return "/targetpool_get.json";
- }
-
- @Override @Consumes(MediaType.APPLICATION_JSON)
- public TargetPool expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public TargetPool expected(String baseUrl) {
- return TargetPool.create( //
- "5199309593612841404", // id
- URI.create(baseUrl + "/party/regions/us-central1/targetPools/test-targetpool"), // selfLink
- parse("2014-01-07T05:25:27.783-08:00"), // creationTimestamp
- "test-targetpool", // name
- null, // description
- URI.create(baseUrl + "/party/regions/us-central1"), // region
- null, // healthChecks
- null, // instances
- SessionAffinityValue.NONE, // sessionAffinity
- null, // failoverRatio
- null // backupPool
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapListTest.java
deleted file mode 100644
index a5b30c4..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapListTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.UrlMap;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseUrlMapListTest extends BaseGoogleComputeEngineParseTest<ListPage<UrlMap>> {
-
- @Override
- public String resource() {
- return "/url_map_list.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<UrlMap> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<UrlMap> expected(String baseUrl) {
- return ForwardingListPage.create(
- ImmutableList.of(new ParseUrlMapTest().expected(baseUrl),
- UrlMap.create("13741966667737398120", // id
- new SimpleDateFormatDateService().iso8601DateParse("2014-07-23T12:39:50.022-07:00"), // creationTimestamp
- URI.create(baseUrl + "/myproject/global/urlMaps/jclouds-test-2"), // selfLink
- "jclouds-test-2", // name
- "Basic url map", // description
- null, // hostRules
- null, // pathMatchers
- null, // urlMapTests
- URI.create(baseUrl + "/myproject/global/backendServices/jclouds-test"), // defaultService
- "EDqhvJucpz4=")), // fingerprint
- null);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapTest.java
deleted file mode 100644
index f266f6d..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapTest.java
+++ /dev/null
@@ -1,81 +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.parse;
-
-import java.net.URI;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.UrlMap;
-import org.jclouds.googlecomputeengine.domain.UrlMap.UrlMapTest;
-import org.jclouds.googlecomputeengine.domain.UrlMap.HostRule;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher.PathRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseUrlMapTest extends BaseGoogleComputeEngineParseTest<UrlMap> {
-
- @Override
- public String resource() {
- return "/url_map_get.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public UrlMap expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public UrlMap expected(String baseUrl) {
- URI service = URI.create(baseUrl + "/myproject/global/backendServices/jclouds-test");
-
- List<HostRule> hostRules = ImmutableList.of(HostRule.create(null, // description
- ImmutableList.of("jclouds-test"), // hosts
- "path")); // pathMatcher
-
- List<PathMatcher> pathMatchers = ImmutableList.of(PathMatcher.create("path", // name
- null, // description
- service, // defaultService
- ImmutableList.of(PathRule.create(ImmutableList.of("/"), // paths
- service // service
- )))); // pathRules
-
- List<UrlMapTest> urlMapTests = ImmutableList.of(UrlMapTest.create(null, // description
- "jclouds-test", // host
- "/test/path", // path
- service)); // service
-
- return UrlMap.create("13741966667737398119", // id
- new SimpleDateFormatDateService().iso8601DateParse("2014-07-23T12:39:50.022-07:00"), // creationTimestamp
- URI.create(baseUrl + "/myproject/global/urlMaps/jclouds-test"), // selfLink
- "jclouds-test", // name
- "Sample url map", // description
- hostRules, // hostRules
- pathMatchers, // pathMatchers
- urlMapTests, // urlMapTests
- service, // defaultService
- "EDmhvJucpz4="); // fingerprint
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapValidateTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapValidateTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapValidateTest.java
deleted file mode 100644
index 06fdc6b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseUrlMapValidateTest.java
+++ /dev/null
@@ -1,56 +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.parse;
-
-import java.net.URI;
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.UrlMapValidateResult;
-import org.jclouds.googlecomputeengine.domain.UrlMapValidateResult.UrlMapValidateResultInternal.TestFailure;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseUrlMapValidateTest extends BaseGoogleComputeEngineParseTest<UrlMapValidateResult> {
-
- @Override
- public String resource() {
- return "/url_map_validate.json";
- }
-
- @Override
- @Consumes(APPLICATION_JSON)
- public UrlMapValidateResult expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public UrlMapValidateResult expected(String baseUrl) {
- return UrlMapValidateResult.create(false, // loadSucceded
- ImmutableList.of("jclouds-test"), // loadError
- false, // testPassed
- ImmutableList.of(TestFailure.create("jclouds-test", // host
- "/test/path", // path
- URI.create(baseUrl + "/myproject/global/backendServices/jclouds-test"), // expectedService
- URI.create(baseUrl + "/myproject/global/backendServices/jclouds-test-2") //actualService
- ))); //testFailures)
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneListTest.java
deleted file mode 100644
index 9bd0930..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneListTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseZoneListTest")
-public class ParseZoneListTest extends BaseGoogleComputeEngineParseTest<ListPage<Zone>> {
-
- @Override
- public String resource() {
- return "/zone_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Zone> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Zone> expected(String baseUrl) {
- Zone zone1 = new ParseZoneTest().expected(baseUrl);
- Zone zone2 = Zone.create( //
- "13024414164050619686", // id
- parse("2012-10-24T20:13:19.271"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-b"), // selfLink
- "us-central1-b", // name
- "us-central1-b", // description
- Zone.Status.UP, // status
- ImmutableList.of( // maintenanceWindows
- Zone.MaintenanceWindow.create( //
- "2013-02-17-planned-outage", // name
- "maintenance zone", // description
- parse("2013-02-17T08:00:00.000"), // beginTime
- parse("2013-03-03T08:00:00.000") // endTime)
- )), //
- null, // deprecated
- "us-central1", // region
- null // availableMachineTypes
- );
- return ForwardingListPage.create( //
- ImmutableList.of(zone1, zone2), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneOperationTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneOperationTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneOperationTest.java
deleted file mode 100644
index 3a3b935..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneOperationTest.java
+++ /dev/null
@@ -1,69 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseZoneOperationTest")
-public class ParseZoneOperationTest extends BaseGoogleComputeEngineParseTest<Operation> {
-
- @Override
- public String resource() {
- return "/zone_operation.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Operation expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Operation expected(String baseUrl) {
- return Operation.create( //
- "13053095055850848306", // id
- parse("2013-07-26T13:57:20.204-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/operations/operation-1354084865060"),
- "operation-1354084865060", // name
- null, // description
- URI.create(baseUrl + "/party/zones/us-central1-a/instances/test-1"),
- "13053094017547040099", // targetId
- null, // clientOperationId
- Operation.Status.DONE, // status
- null, // statusMessage
- "user@developer.gserviceaccount.com", // user
- 100, // progress
- parse("2012-11-28T06:41:05.060"), // insertTime
- parse("2012-11-28T06:41:05.142"), // startTime
- parse("2012-11-28T06:41:06.142"), // endTime
- null, // httpErrorStatusCode
- null, // httpErrorMessage
- "insert", // operationType
- null, // errors
- null, // warnings
- null, // region
- URI.create(baseUrl + "/party/zones/us-central1-a") // zone
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneTest.java
deleted file mode 100644
index 7bfd66c..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneTest.java
+++ /dev/null
@@ -1,65 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseZoneTest")
-public class ParseZoneTest extends BaseGoogleComputeEngineParseTest<Zone> {
-
- @Override
- public String resource() {
- return "/zone_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Zone expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Zone expected(String baseUrl) {
- return Zone.create( //
- "13020128040171887099", // id
- parse("2012-10-19T16:42:54.131"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a"), // selfLink
- "us-central1-a", // name
- "us-central1-a", // description
- Zone.Status.DOWN, // status
- ImmutableList.of( // maintenanceWindows
- Zone.MaintenanceWindow.create( //
- "2012-11-10-planned-outage", // name
- "maintenance zone", // description
- parse("2012-11-10T20:00:00.000"), // beginTime
- parse("2012-12-02T20:00:00.000") // endTime)
- )), //
- null, // deprecated
- "us-central1", // region
- null // availableMachineTypes
- );
- }
-}
[09/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiLiveTest.java
deleted file mode 100644
index 6d43913..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiLiveTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class DiskTypeApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private DiskType diskType;
-
- private DiskTypeApi api() {
- return api.diskTypesInZone(DEFAULT_ZONE_NAME);
- }
-
- @Test(groups = "live")
- public void testDiskType() {
-
- Iterator<ListPage<DiskType>> pageIterator = api().list(maxResults(1));
- assertTrue(pageIterator.hasNext());
-
- ListPage<DiskType> page = pageIterator.next();
-
- assertEquals(page.size(), 1);
-
- this.diskType = page.get(0);
- }
-
- @Test(groups = "live", dependsOnMethods = "testDiskType")
- public void testGetDiskType() {
- DiskType diskType = api().get(this.diskType.name());
- assertNotNull(diskType);
- assertDiskTypeEquals(diskType, this.diskType);
- }
-
- private void assertDiskTypeEquals(DiskType result, DiskType expected) {
- assertEquals(result.name(), expected.name());
- assertEquals(result.validDiskSize(), expected.validDiskSize());
- assertEquals(result.zone(), expected.zone());
- assertEquals(result.defaultDiskSizeGb(), expected.defaultDiskSizeGb());
- assertEquals(result.selfLink(), expected.selfLink());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiMockTest.java
deleted file mode 100644
index 07b8cf2..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiMockTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseDiskTypeListTest;
-import org.jclouds.googlecomputeengine.parse.ParseDiskTypeTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "DiskTypeApiMockTest", singleThreaded = true)
-public class DiskTypeApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/disktype.json"));
-
- assertEquals(diskTypeApi().get("pd-standard"),
- new ParseDiskTypeTest().expected());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/diskTypes/pd-standard");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(diskTypeApi().get("pd-standard"));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/diskTypes/pd-standard");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/disktype_list.json"));
-
- assertEquals(diskTypeApi().list().next(), new ParseDiskTypeListTest().expected());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/diskTypes");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(diskTypeApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/diskTypes");
- }
-
- public DiskTypeApi diskTypeApi() {
- return api().diskTypesInZone("us-central1-a");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java
deleted file mode 100644
index a56cc3e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static com.google.common.collect.Iterables.getOnlyElement;
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "live", testName = "FirewallApiLiveTest")
-public class FirewallApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String FIREWALL_NAME = "firewall-api-live-test-firewall";
- private static final String FIREWALL_NETWORK_NAME = "firewall-api-live-test-network";
- private static final String IPV4_RANGE = "10.0.0.0/8";
-
- private FirewallApi api() {
- return api.firewalls();
- }
-
- @Test(groups = "live")
- public void testInsertFirewall() {
- // need to insert the network first
- assertOperationDoneSuccessfully(
- api.networks().createInIPv4Range(FIREWALL_NETWORK_NAME, IPV4_RANGE));
-
- FirewallOptions firewall = new FirewallOptions()
- .addAllowedRule(Firewall.Rule.create("tcp", ImmutableList.of("22")))
- .addSourceRange("10.0.0.0/8")
- .addSourceTag("tag1")
- .addTargetTag("tag2");
-
- assertOperationDoneSuccessfully(
- api().createInNetwork(FIREWALL_NAME, getNetworkUrl(FIREWALL_NETWORK_NAME), firewall));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertFirewall")
- public void testUpdateFirewall() {
- FirewallOptions firewall = new FirewallOptions()
- .name(FIREWALL_NAME)
- .network(getNetworkUrl(FIREWALL_NETWORK_NAME))
- .addSourceRange("10.0.0.0/8")
- .addSourceTag("tag1")
- .addTargetTag("tag2")
- .allowedRules(ImmutableList.of(Firewall.Rule.create("tcp", ImmutableList.of("23"))));
-
- assertOperationDoneSuccessfully(api().update(FIREWALL_NAME, firewall));
- }
-
- @Test(groups = "live", dependsOnMethods = "testUpdateFirewall")
- public void testPatchFirewall() {
- FirewallOptions firewall = new FirewallOptions()
- .name(FIREWALL_NAME)
- .network(getNetworkUrl(FIREWALL_NETWORK_NAME))
- .allowedRules(ImmutableList.of(Firewall.Rule.create("tcp", ImmutableList.of("22")),
- Firewall.Rule.create("tcp", ImmutableList.of("23"))))
- .addSourceRange("10.0.0.0/8")
- .addSourceTag("tag1")
- .addTargetTag("tag2");
-
- assertOperationDoneSuccessfully(api().update(FIREWALL_NAME, firewall));
- }
-
- @Test(groups = "live", dependsOnMethods = "testPatchFirewall")
- public void testGetFirewall() {
- FirewallOptions patchedFirewall = new FirewallOptions()
- .name(FIREWALL_NAME)
- .network(getNetworkUrl(FIREWALL_NETWORK_NAME))
- .allowedRules(ImmutableList.of(Firewall.Rule.create("tcp", ImmutableList.of("22")),
- Firewall.Rule.create("tcp", ImmutableList.of("23"))))
- .addSourceRange("10.0.0.0/8")
- .addSourceTag("tag1")
- .addTargetTag("tag2");
-
- Firewall firewall = api().get(FIREWALL_NAME);
- assertNotNull(firewall);
- assertFirewallEquals(firewall, patchedFirewall);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetFirewall")
- public void testListFirewall() {
- Iterator<ListPage<Firewall>> firewalls = api().list(filter("name eq " + FIREWALL_NAME));
-
- assertEquals(firewalls.next().size(), 1);
- }
-
- @Test(groups = "live", dependsOnMethods = "testListFirewall")
- public void testDeleteFirewall() {
- assertOperationDoneSuccessfully(api().delete(FIREWALL_NAME));
- assertOperationDoneSuccessfully(api.networks().delete(FIREWALL_NETWORK_NAME));
- }
-
- private void assertFirewallEquals(Firewall result, FirewallOptions expected) {
- assertEquals(result.name(), expected.name());
- assertEquals(getOnlyElement(result.sourceRanges()), getOnlyElement(expected.sourceRanges()));
- assertEquals(getOnlyElement(result.sourceTags()), getOnlyElement(expected.sourceTags()));
- assertEquals(getOnlyElement(result.targetTags()), getOnlyElement(expected.targetTags()));
- assertEquals(result.allowed(), expected.getAllowed());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
deleted file mode 100644
index bae4f72..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiMockTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.jclouds.googlecomputeengine.parse.ParseFirewallListTest;
-import org.jclouds.googlecomputeengine.parse.ParseFirewallTest;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "FirewallApiMockTest", singleThreaded = true)
-public class FirewallApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/firewall_get.json"));
-
- assertEquals(firewallApi().get("jclouds-test"),
- new ParseFirewallTest().expected(url("/projects")));
-
- assertSent(server, "GET", "/projects/party/global/firewalls/jclouds-test");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(firewallApi().get("jclouds-test"));
-
- assertSent(server, "GET", "/projects/party/global/firewalls/jclouds-test");
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(firewallApi().delete("default-allow-internal"),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/firewalls/default-allow-internal");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(firewallApi().delete("default-allow-internal"));
- assertSent(server, "DELETE", "/projects/party/global/firewalls/default-allow-internal");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/firewall_list.json"));
-
- assertEquals(firewallApi().list().next(), new ParseFirewallListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/firewalls");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(firewallApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/firewalls");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- FirewallOptions options = new FirewallOptions()
- .addAllowedRule(Firewall.Rule.create("tcp", ImmutableList.of("22", "23-24")))
- .addSourceTag("tag1")
- .addSourceRange("10.0.1.0/32")
- .addTargetTag("tag2");
-
- assertEquals(firewallApi().createInNetwork("myfw", URI.create(url("/projects/party/global/networks/default")), options),
- new ParseOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/global/firewalls",
- stringFromResource("/firewall_insert.json"));
- }
-
- public void update() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- FirewallOptions options = new FirewallOptions()
- .name("myfw")
- .network(URI.create(url("/projects/party/global/networks/default")))
- .addAllowedRule(Firewall.Rule.create("tcp", ImmutableList.of("22", "23-24")))
- .addSourceTag("tag1")
- .addSourceRange("10.0.1.0/32")
- .addTargetTag("tag2");
-
- assertEquals(firewallApi().update("myfw", options),
- new ParseOperationTest().expected(url("/projects")));
-
- assertSent(server, "PUT", "/projects/party/global/firewalls/myfw",
- stringFromResource("/firewall_insert.json"));
- }
-
- public void patch() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- FirewallOptions options = new FirewallOptions()
- .name("myfw")
- .network(URI.create(url("/projects/party/global/networks/default")))
- .addAllowedRule(Firewall.Rule.create("tcp", ImmutableList.of("22", "23-24")))
- .addSourceTag("tag1")
- .addSourceRange("10.0.1.0/32")
- .addTargetTag("tag2");
-
- assertEquals(firewallApi().patch("myfw", options),
- new ParseOperationTest().expected(url("/projects")));
-
- assertSent(server, "PATCH", "/projects/party/global/firewalls/myfw",
- stringFromResource("/firewall_insert.json"));
- }
-
- FirewallApi firewallApi(){
- return api().firewalls();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java
deleted file mode 100644
index 625c958..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class ForwardingRuleApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String FORWARDING_RULE_NAME = "forwarding-rule-api-live-test";
- private static final String TARGETPOOL_NAME = "forwarding-rule-api-live-test-targetpool";
- private static final String TARGETPOOL_NAME_NEW = "forwarding-rule-api-live-test-new-targetpool";
- private static final String DESCRIPTION = "Forwarding rule api live test forwarding rule.";
- private static final String ADDRESS_NAME = "forwarding-rule-api-address";
- private TargetPool targetPool;
- private TargetPool newTargetPool;
- private Address address;
-
- /**
- * The API under test
- * @return
- */
- private ForwardingRuleApi api() {
- return api.forwardingRulesInRegion(DEFAULT_REGION_NAME);
- }
-
- private TargetPoolApi targetPoolApi() {
- return api.targetPoolsInRegion(DEFAULT_REGION_NAME);
- }
-
- private AddressApi addressApi(){
- return api.addressesInRegion(DEFAULT_REGION_NAME);
- }
-
- @BeforeClass
- public void init() {
- TargetPoolCreationOptions targetPoolCreationOptions = new TargetPoolCreationOptions.Builder(TARGETPOOL_NAME).build();
- assertOperationDoneSuccessfully(targetPoolApi().create(targetPoolCreationOptions));
- targetPool = targetPoolApi().get(TARGETPOOL_NAME);
-
- targetPoolCreationOptions = new TargetPoolCreationOptions.Builder(TARGETPOOL_NAME_NEW).build();
- assertOperationDoneSuccessfully(targetPoolApi().create(targetPoolCreationOptions));
- newTargetPool = targetPoolApi().get(TARGETPOOL_NAME_NEW);
-
- assertOperationDoneSuccessfully(addressApi().create(ADDRESS_NAME));
- address = addressApi().get(ADDRESS_NAME);
- }
-
- @AfterClass
- public void tearDown() {
- assertOperationDoneSuccessfully(targetPoolApi().delete(TARGETPOOL_NAME));
- assertOperationDoneSuccessfully(targetPoolApi().delete(TARGETPOOL_NAME_NEW));
- assertOperationDoneSuccessfully(addressApi().delete(ADDRESS_NAME));
- }
-
- @Test(groups = "live")
- public void testInsertForwardingRule() {
- ForwardingRuleCreationOptions forwardingRuleCreationOptions = new ForwardingRuleCreationOptions.Builder()
- .description(DESCRIPTION)
- .ipAddress(address.address())
- .ipProtocol(ForwardingRule.IPProtocol.TCP)
- .target(targetPool.selfLink())
- .build();
- assertOperationDoneSuccessfully(api().create(FORWARDING_RULE_NAME, forwardingRuleCreationOptions));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertForwardingRule")
- public void testGetForwardingRule() {
- ForwardingRule forwardingRule = api().get(FORWARDING_RULE_NAME);
- assertNotNull(forwardingRule);
- assertEquals(forwardingRule.name(), FORWARDING_RULE_NAME);
- assertEquals(forwardingRule.description(), DESCRIPTION);
- assertEquals(forwardingRule.ipAddress(), address.address());
- assertEquals(forwardingRule.ipProtocol(), ForwardingRule.IPProtocol.TCP);
- assertEquals(forwardingRule.target(), targetPool.selfLink());
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetForwardingRule")
- public void testSetTargetForwardingRule(){
- assertOperationDoneSuccessfully(api().setTarget(FORWARDING_RULE_NAME, newTargetPool.selfLink()));
- ForwardingRule forwardingRule = api().get(FORWARDING_RULE_NAME);
- assertNotNull(forwardingRule);
- assertEquals(forwardingRule.name(), FORWARDING_RULE_NAME);
- assertEquals(forwardingRule.target(), newTargetPool.selfLink());
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertForwardingRule")
- public void testListForwardingRule() {
- ListPage<ForwardingRule> forwardingRule = api().list(filter("name eq " + FORWARDING_RULE_NAME)).next();
- assertEquals(forwardingRule.size(), 1);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testListForwardingRule", "testSetTargetForwardingRule"}, alwaysRun = true)
- public void testDeleteForwardingRule() {
- assertOperationDoneSuccessfully(api().delete(FORWARDING_RULE_NAME));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiMockTest.java
deleted file mode 100644
index 7924e1b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiMockTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseForwardingRuleListTest;
-import org.jclouds.googlecomputeengine.parse.ParseForwardingRuleTest;
-import org.jclouds.googlecomputeengine.parse.ParseRegionOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ForwardingRuleApiMockTest", singleThreaded = true)
-public class ForwardingRuleApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/forwardingrule_get.json"));
-
- assertEquals(forwardingRuleApi().get("test-forwarding-rule"),
- new ParseForwardingRuleTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1/forwardingRules/test-forwarding-rule");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(forwardingRuleApi().get("test-forwarding-rule"));
- assertSent(server, "GET", "/projects/party/regions/us-central1/forwardingRules/test-forwarding-rule");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- ForwardingRuleCreationOptions forwardingRuleCreationOptions = new ForwardingRuleCreationOptions.Builder()
- .target(URI.create(url("/projects/party/regions/europe-west1/targetPools/test-target-pool"))).build();
- assertEquals(forwardingRuleApi().create("test-forwarding-rule", forwardingRuleCreationOptions),
- new ParseRegionOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/regions/us-central1/forwardingRules",
- stringFromResource("/forwardingrule_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- assertEquals(forwardingRuleApi().delete("test-forwarding-rule"),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/regions/us-central1/forwardingRules/test-forwarding-rule");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(forwardingRuleApi().delete("test-forwarding-rule"));
- assertSent(server, "DELETE", "/projects/party/regions/us-central1/forwardingRules/test-forwarding-rule");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/forwardingrule_list.json"));
-
- assertEquals(forwardingRuleApi().list().next(), new ParseForwardingRuleListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1/forwardingRules");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(forwardingRuleApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/regions/us-central1/forwardingRules");
- }
-
- public void setTarget() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- URI newTarget = URI.create(url("/projects/party/regions/europe-west1/targetPools/test-target-pool"));
- assertEquals(forwardingRuleApi().setTarget("testForwardingRule", newTarget), new ParseRegionOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/regions/us-central1/forwardingRules/testForwardingRule/setTarget",
- stringFromResource("/forwardingrule_set_target.json"));
- }
-
- public void setTarget_partialUrl() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- URI newTarget = URI.create("projects/project-id/regions/region/targetPools/target-pool");
- assertEquals(forwardingRuleApi().setTarget("testForwardingRule", newTarget), new ParseRegionOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/regions/us-central1/forwardingRules/testForwardingRule/setTarget",
- "{\"target\":\"projects/project-id/regions/region/targetPools/target-pool\"}");
- }
-
- ForwardingRuleApi forwardingRuleApi() {
- return api().forwardingRulesInRegion("us-central1");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java
deleted file mode 100644
index 6245309..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule.IPProtocol;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.jclouds.googlecomputeengine.options.UrlMapOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-import java.net.URI;
-import java.util.List;
-
-
-
-public class GlobalForwardingRuleApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String GLOBAL_FORWARDING_RULE_NAME = "global-forwarding-rule-api-live-test-forwarding-rule";
- private static final String GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME = "global-"
- + "forwarding-rule-api-live-test-target-http-proxy";
- private static final String GLOBAL_FORWARDING_RULE_URL_MAP_NAME = "global-"
- + "forwarding-rule-api-live-test-url-map";
- private static final String GLOBAL_FORWARDING_RULE_BACKEND_SERVICE_NAME = "global-"
- + "forwarding-rule-api-live-test-backend-service";
- private static final String GLOBAL_FORWARDING_RULE_HEALTH_CHECK_NAME = "global-"
- + "forwarding-rule-api-live-test-health-check";
- private static final String PORT_RANGE = "80";
-
- private ForwardingRuleApi api() {
- return api.globalForwardingRules();
- }
-
- @Test(groups = "live")
- public void testInsertGlobalForwardingRule() {
-
- assertOperationDoneSuccessfully(api.httpHeathChecks().insert(GLOBAL_FORWARDING_RULE_HEALTH_CHECK_NAME));
-
-
- List<URI> healthChecks = ImmutableList.of(getHealthCheckUrl(GLOBAL_FORWARDING_RULE_HEALTH_CHECK_NAME));
- BackendServiceOptions b = new BackendServiceOptions.Builder(GLOBAL_FORWARDING_RULE_BACKEND_SERVICE_NAME, healthChecks).build();
- assertOperationDoneSuccessfully(api.backendServices()
- .create(b));
-
- UrlMapOptions map = new UrlMapOptions.Builder().name(GLOBAL_FORWARDING_RULE_URL_MAP_NAME)
- .description("simple url map")
- .defaultService(getBackendServiceUrl(GLOBAL_FORWARDING_RULE_BACKEND_SERVICE_NAME)).build();
- assertOperationDoneSuccessfully(api.urlMaps()
- .create(map));
- assertOperationDoneSuccessfully(api.targetHttpProxies()
- .create(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME,
- getUrlMapUrl(GLOBAL_FORWARDING_RULE_URL_MAP_NAME)));
- assertOperationDoneSuccessfully(
- api().create(GLOBAL_FORWARDING_RULE_NAME,
- new ForwardingRuleCreationOptions.Builder().target(getTargetHttpProxyUrl(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME))
- .portRange(PORT_RANGE).build()));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertGlobalForwardingRule")
- public void testGetGlobalForwardingRule() {
- ForwardingRule forwardingRule = api().get(GLOBAL_FORWARDING_RULE_NAME);
- assertNotNull(forwardingRule);
- ForwardingRuleCreationOptions expected = new ForwardingRuleCreationOptions.Builder()
- .target(getTargetHttpProxyUrl(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME))
- .portRange("80-80")
- .ipProtocol(IPProtocol.TCP)
- .build();
- assertGlobalForwardingRuleEquals(forwardingRule, expected);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetGlobalForwardingRule")
- public void testSetGlobalForwardingRuleTarget() {
- assertOperationDoneSuccessfully(api.targetHttpProxies()
- .create(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME + "-2",
- getUrlMapUrl(GLOBAL_FORWARDING_RULE_URL_MAP_NAME)));
- assertOperationDoneSuccessfully(api().setTarget(GLOBAL_FORWARDING_RULE_NAME,
- getTargetHttpProxyUrl(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME + "-2")));
- }
-
- @Test(groups = "live", dependsOnMethods = "testSetGlobalForwardingRuleTarget")
- public void testListGlobalForwardingRule() {
- ListPage<ForwardingRule> forwardingRules = api().list(filter("name eq " + GLOBAL_FORWARDING_RULE_NAME)).next();
- assertEquals(forwardingRules.size(), 1);
- }
-
- @Test(groups = "live", dependsOnMethods = "testListGlobalForwardingRule")
- public void testDeleteGlobalForwardingRule() {
- assertOperationDoneSuccessfully(api().delete(GLOBAL_FORWARDING_RULE_NAME));
-
- // Teardown other created resources
- assertOperationDoneSuccessfully(api.targetHttpProxies()
- .delete(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME));
-
- assertOperationDoneSuccessfully(api.targetHttpProxies()
- .delete(GLOBAL_FORWARDING_RULE_TARGET_HTTP_PROXY_NAME + "-2"));
-
- assertOperationDoneSuccessfully(api.urlMaps()
- .delete(GLOBAL_FORWARDING_RULE_URL_MAP_NAME));
-
- assertOperationDoneSuccessfully(api.backendServices()
- .delete(GLOBAL_FORWARDING_RULE_BACKEND_SERVICE_NAME));
-
- assertOperationDoneSuccessfully(api.httpHeathChecks().delete(GLOBAL_FORWARDING_RULE_HEALTH_CHECK_NAME));
-
- }
-
- private void assertGlobalForwardingRuleEquals(ForwardingRule result, ForwardingRuleCreationOptions expected) {
- assertEquals(result.target(), expected.target());
- assertEquals(result.ipProtocol(), expected.ipProtocol());
- assertEquals(result.description(), expected.description());
- assertEquals(result.portRange(), expected.portRange());
- assertTrue(result.ipAddress() != null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiMockTest.java
deleted file mode 100644
index 0656193..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiMockTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseForwardingRuleListTest;
-import org.jclouds.googlecomputeengine.parse.ParseForwardingRuleTest;
-import org.jclouds.googlecomputeengine.parse.ParseRegionOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "GlobalForwardingRuleApiMockTest", singleThreaded = true)
-public class GlobalForwardingRuleApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/forwardingrule_get.json"));
-
- assertEquals(globalForwardingRuleApi().get("test-forwarding-rule"),
- new ParseForwardingRuleTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/forwardingRules/test-forwarding-rule");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(globalForwardingRuleApi().get("test-forwarding-rule"));
- assertSent(server, "GET", "/projects/party/global/forwardingRules/test-forwarding-rule");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- ForwardingRuleCreationOptions forwardingRuleCreationOptions = new ForwardingRuleCreationOptions.Builder()
- .target(URI.create(url("/projects/party/regions/europe-west1/targetPools/test-target-pool"))).build();
-
- assertEquals(globalForwardingRuleApi().create("test-forwarding-rule", forwardingRuleCreationOptions),
- new ParseRegionOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/global/forwardingRules",
- stringFromResource("/forwardingrule_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- assertEquals(globalForwardingRuleApi().delete("test-forwarding-rule"),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/forwardingRules/test-forwarding-rule");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(globalForwardingRuleApi().delete("test-forwarding-rule"));
- assertSent(server, "DELETE", "/projects/party/global/forwardingRules/test-forwarding-rule");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/forwardingrule_list.json"));
-
- assertEquals(globalForwardingRuleApi().list().next(), new ParseForwardingRuleListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/forwardingRules");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(globalForwardingRuleApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/forwardingRules");
- }
-
- public void setTarget() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- URI newTarget = URI.create(url("/projects/party/regions/europe-west1/targetPools/test-target-pool"));
- assertEquals(globalForwardingRuleApi().setTarget("testForwardingRule", newTarget),
- new ParseRegionOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/global/forwardingRules/testForwardingRule/setTarget",
- stringFromResource("/forwardingrule_set_target.json"));
- }
-
- ForwardingRuleApi globalForwardingRuleApi(){
- return api().globalForwardingRules();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiLiveTest.java
deleted file mode 100644
index f3dcad9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiLiveTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotEquals;
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.HttpHealthCheck;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.Iterables;
-
-public class HttpHealthCheckApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String HTTP_HEALTH_CHECK_NAME = "http-health-check-api-live-test";
- private static final Integer OFFSET = 2;
-
- private HttpHealthCheckCreationOptions options;
-
- private HttpHealthCheckApi api() {
- return api.httpHeathChecks();
- }
-
- @Test(groups = "live")
- public void testInsertHttpHealthCheck() {
- options = new HttpHealthCheckCreationOptions.Builder()
- .port(56)
- .checkIntervalSec(40)
- .timeoutSec(40)
- .healthyThreshold(5)
- .unhealthyThreshold(3)
- .description("A First Health Check!")
- .buildWithDefaults();
- assertOperationDoneSuccessfully(api().insert(HTTP_HEALTH_CHECK_NAME, options));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertHttpHealthCheck")
- public void testGetHttpHealthCheck() {
- HttpHealthCheck httpHealthCheck = api().get(HTTP_HEALTH_CHECK_NAME);
- assertNotNull(httpHealthCheck);
- assertEquals(httpHealthCheck.name(), HTTP_HEALTH_CHECK_NAME);
- assertEquals(httpHealthCheck.port(), options.port());
- assertEquals(httpHealthCheck.checkIntervalSec(), options.checkIntervalSec());
- assertEquals(httpHealthCheck.timeoutSec(), options.timeoutSec());
- assertEquals(httpHealthCheck.healthyThreshold(), options.healthyThreshold());
- assertEquals(httpHealthCheck.unhealthyThreshold(), options.unhealthyThreshold());
- assertEquals(httpHealthCheck.description(), options.description());
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertHttpHealthCheck")
- public void testListHttpHealthCheck() {
- ListPage<HttpHealthCheck> httpHealthCheck = api().list(filter("name eq " + HTTP_HEALTH_CHECK_NAME)).next();
- assertEquals(Iterables.size(httpHealthCheck), 1);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetHttpHealthCheck")
- public void testPatchHttpHealthCheck() {
- HttpHealthCheckCreationOptions newOptions = new HttpHealthCheckCreationOptions.Builder()
- .port(options.port() + OFFSET)
- .checkIntervalSec(options.checkIntervalSec() + OFFSET)
- .timeoutSec(options.timeoutSec() + OFFSET)
- .buildForPatch();
- assertOperationDoneSuccessfully(api().patch(HTTP_HEALTH_CHECK_NAME, newOptions));
-
- // Check changes happened and others unchanged.
- HttpHealthCheck httpHealthCheck = api().get(HTTP_HEALTH_CHECK_NAME);
- assertNotNull(httpHealthCheck);
- assertEquals(httpHealthCheck.name(), HTTP_HEALTH_CHECK_NAME);
- assertEquals(httpHealthCheck.port(), newOptions.port());
- assertEquals(httpHealthCheck.checkIntervalSec(), newOptions.checkIntervalSec());
- assertEquals(httpHealthCheck.timeoutSec(), newOptions.timeoutSec());
- assertEquals(httpHealthCheck.healthyThreshold(), options.healthyThreshold());
- assertEquals(httpHealthCheck.unhealthyThreshold(), options.unhealthyThreshold());
- assertEquals(httpHealthCheck.description(), options.description());
- }
-
- @Test(groups = "live", dependsOnMethods = "testPatchHttpHealthCheck")
- public void testUpdateHttpHealthCheck() {
- HttpHealthCheckCreationOptions newOptions = new HttpHealthCheckCreationOptions.Builder()
- .checkIntervalSec(options.checkIntervalSec() - OFFSET)
- .timeoutSec(options.timeoutSec() - OFFSET)
- .buildWithDefaults();
- assertOperationDoneSuccessfully(api().update(HTTP_HEALTH_CHECK_NAME, newOptions));
-
- // Check changes happened.
- HttpHealthCheck httpHealthCheck = api().get(HTTP_HEALTH_CHECK_NAME);
- assertNotNull(httpHealthCheck);
- assertEquals(httpHealthCheck.name(), HTTP_HEALTH_CHECK_NAME);
- assertEquals(httpHealthCheck.checkIntervalSec(), newOptions.checkIntervalSec());
- assertEquals(httpHealthCheck.timeoutSec(), newOptions.timeoutSec());
- // Update overwrites unspecified parameters to their defaults.
- assertNotEquals(httpHealthCheck.healthyThreshold(), options.healthyThreshold());
- assertNotEquals(httpHealthCheck.unhealthyThreshold(), options.unhealthyThreshold());
- assertNotEquals(httpHealthCheck.description(), options.description());
- }
-
- @Test(groups = "live", dependsOnMethods = {"testListHttpHealthCheck", "testUpdateHttpHealthCheck"}, alwaysRun = true)
- public void testDeleteHttpHealthCheck() {
- assertOperationDoneSuccessfully(api().delete(HTTP_HEALTH_CHECK_NAME));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
deleted file mode 100644
index 9efa8d9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiMockTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseHttpHealthCheckListTest;
-import org.jclouds.googlecomputeengine.parse.ParseHttpHealthCheckTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "HttpHealthCheckApiMockTest", singleThreaded = true)
-public class HttpHealthCheckApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception{
- server.enqueue(jsonResponse("/httphealthcheck_get.json"));
-
- assertEquals(httpHealthCheckApi().get("http-health-check-api-live-test"),
- new ParseHttpHealthCheckTest().expected(url("/projects")));
-
- assertSent(server, "GET", "/projects/party/global/httpHealthChecks/http-health-check-api-live-test");
- }
-
- public void get_4xx() throws Exception{
- server.enqueue(response404());
-
- assertNull(httpHealthCheckApi().get("http-health-check-api-live-test"));
- assertSent(server, "GET", "/projects/party/global/httpHealthChecks/http-health-check-api-live-test");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- HttpHealthCheckCreationOptions options = new HttpHealthCheckCreationOptions.Builder()
- .timeoutSec(0).unhealthyThreshold(0).buildWithDefaults();
- assertEquals(httpHealthCheckApi().insert("http-health-check", options),
- new ParseGlobalOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/global/httpHealthChecks",
- stringFromResource("/httphealthcheck_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- assertEquals(httpHealthCheckApi().delete("http-health-check"),
- new ParseGlobalOperationTest().expected(url("/projects")));
-
- assertSent(server, "DELETE", "/projects/party/global/httpHealthChecks/http-health-check");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(httpHealthCheckApi().delete("http-health-check"));
-
- assertSent(server, "DELETE", "/projects/party/global/httpHealthChecks/http-health-check");
- }
-
- public void update() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- HttpHealthCheckCreationOptions options = new HttpHealthCheckCreationOptions.Builder()
- .timeoutSec(0).unhealthyThreshold(0).buildWithDefaults();
- assertEquals(httpHealthCheckApi().update("http-health-check", options),
- new ParseGlobalOperationTest().expected(url("/projects")));
-
- assertSent(server, "PUT", "/projects/party/global/httpHealthChecks/http-health-check",
- stringFromResource("/httphealthcheck_insert.json"));
- }
-
- public void patch() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- HttpHealthCheckCreationOptions options = new HttpHealthCheckCreationOptions.Builder()
- .timeoutSec(0).unhealthyThreshold(0).buildForPatch();
- assertEquals(httpHealthCheckApi().patch("http-health-check", options),
- new ParseGlobalOperationTest().expected(url("/projects")));
-
- assertSent(server, "PATCH", "/projects/party/global/httpHealthChecks/http-health-check",
- stringFromResource("/httphealthcheck_patch.json"));
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/httphealthcheck_list.json"));
-
- assertEquals(httpHealthCheckApi().list().next(),
- new ParseHttpHealthCheckListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/httpHealthChecks");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(httpHealthCheckApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/httpHealthChecks");
- }
-
-
- HttpHealthCheckApi httpHealthCheckApi() {
- return api().httpHeathChecks();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java
deleted file mode 100644
index db6346d..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Deprecated.State;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.DeprecateOptions;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.testng.annotations.Test;
-
-public class ImageApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String DISK_NAME = "image-api-live-test-disk";
- public static final int sizeGb = 10;
- public static final String IMAGE_NAME = "image-api-live-test-image";
-
- private Image image;
- private URI diskURI;
-
- private ImageApi api(){
- return api.images();
- }
-
- private DiskApi diskApi() {
- return api.disksInZone(DEFAULT_ZONE_NAME);
- }
-
- @Test(groups = "live")
- public void testListImage() {
- Iterator<ListPage<Image>> images = api().listInProject("centos-cloud", maxResults(1));
-
- List<Image> imageAsList = images.next();
-
- assertEquals(imageAsList.size(), 1);
-
- this.image = imageAsList.get(0);
- }
-
- @Test(groups = "live", dependsOnMethods = "testListImage")
- public void testGetImage() {
- assertEquals(image, api().get(image.selfLink()));
- }
-
- @Test(groups = "live")
- public void testInsertDisk() {
- assertOperationDoneSuccessfully(diskApi().create(DISK_NAME,
- new DiskCreationOptions.Builder().sizeGb(sizeGb).build()));
- Disk disk = diskApi().get(DISK_NAME);
- diskURI = disk.selfLink();
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertDisk")
- public void testCreateImageFromPD(){
- assertOperationDoneSuccessfully(api().createFromDisk(IMAGE_NAME, diskURI.toString()));
- }
-
- @Test(groups = "live", dependsOnMethods = "testCreateImageFromPD")
- public void testGetCreatedImage(){
- Image image = api().get(IMAGE_NAME);
- assertImageEquals(image);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetCreatedImage")
- public void testDeprecateImage(){
- Image image = api().get(IMAGE_NAME);
- assertNull(image.deprecated());
- String deprecated = "2015-07-16T22:16:13.468Z";
- String obsolete = "2016-10-16T22:16:13.468Z";
- String deleted = "2017-01-16T22:16:13.468Z";
-
- URI replacement = URI.create("https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326test");
-
- DeprecateOptions deprecateOptions = new DeprecateOptions.Builder().state(State.DEPRECATED)
- .replacement(replacement)
- .deprecated(new SimpleDateFormatDateService().iso8601DateParse(deprecated))
- .obsolete(new SimpleDateFormatDateService().iso8601DateParse(obsolete))
- .deleted(new SimpleDateFormatDateService().iso8601DateParse(deleted))
- .build();
-
- assertOperationDoneSuccessfully(api().deprecate(IMAGE_NAME, deprecateOptions));
-
- image = api().get(IMAGE_NAME);
- assertEquals(image.deprecated().state(), State.DEPRECATED);
- assertEquals(image.deprecated().replacement(), replacement);
- assertEquals(image.deprecated().deprecated(), deprecated);
- assertEquals(image.deprecated().obsolete(), obsolete);
- assertEquals(image.deprecated().deleted(), deleted);
- }
-
- @Test(groups = "live", dependsOnMethods = "testDeprecateImage", alwaysRun = true)
- public void testCleanup(){
- assertOperationDoneSuccessfully(api().delete(IMAGE_NAME));
- assertOperationDoneSuccessfully(diskApi().delete(DISK_NAME));
- }
-
- private void assertImageEquals(Image result) {
- assertEquals(result.name(), IMAGE_NAME);
- assertEquals(result.sourceType(), "RAW");
- assertEquals(result.selfLink(), getImageUrl(IMAGE_NAME) );
- }
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiMockTest.java
deleted file mode 100644
index 7af2b8e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiMockTest.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.Deprecated;
-import org.jclouds.googlecomputeengine.domain.Deprecated.State;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.DeprecateOptions;
-import org.jclouds.googlecomputeengine.options.ImageCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseImageListTest;
-import org.jclouds.googlecomputeengine.parse.ParseImageTest;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ImageApiMockTest", singleThreaded = true)
-public class ImageApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/image_get.json"));
-
- assertEquals(imageApi().get(URI.create(url("/projects/party/global/images/centos-6-2-v20120326"))),
- new ParseImageTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/images/centos-6-2-v20120326");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(imageApi().get(URI.create(url("/projects/party/global/images/centos-6-2-v20120326"))));
- assertSent(server, "GET", "/projects/party/global/images/centos-6-2-v20120326");
- }
-
- public void getByName() throws Exception {
- server.enqueue(jsonResponse("/image_get.json"));
-
- assertEquals(imageApi().get("centos-6-2-v20120326"), new ParseImageTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/images/centos-6-2-v20120326");
- }
-
- public void getByName_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(imageApi().get("centos-6-2-v20120326"));
- assertSent(server, "GET", "/projects/party/global/images/centos-6-2-v20120326");
- }
-
- public void deleteImage_2xx() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(imageApi().delete("centos-6-2-v20120326"),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/images/centos-6-2-v20120326");
- }
-
- public void deleteImage_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(imageApi().delete("centos-6-2-v20120326"));
- assertSent(server, "DELETE", "/projects/party/global/images/centos-6-2-v20120326");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/image_list.json"));
-
- assertEquals(imageApi().list().next(), new ParseImageListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/images");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(imageApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/images");
- }
-
- public void listInProject() throws Exception {
- server.enqueue(jsonResponse("/image_list.json"));
-
- assertEquals(imageApi().listInProject("centos-cloud").next(), new ParseImageListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/centos-cloud/global/images");
- }
-
- public void listInProject_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(imageApi().listInProject("centos-cloud").hasNext());
- assertSent(server, "GET", "/projects/centos-cloud/global/images");
- }
-
- public void createImageFromPd_2xx() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(imageApi().createFromDisk("my-image", url("/projects/party/zones/us-central1-a/disks/mydisk")),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/images", stringFromResource("/image_insert_from_pd.json"));
- }
-
- public void createImage_options() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- ImageCreationOptions options = new ImageCreationOptions.Builder("name")
- .description("this is a test")
- .sourceDisk("projects/project/zones/zone/disks/disks")
- .deprecated(Deprecated.create(State.DEPRECATED, null, null, null, null)).build();
- assertEquals(imageApi().create(options),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/images",
- "{\"name\":\"name\",\"description\":\"this is a test\",\""
- + "deprecated\":{\"state\":\"DEPRECATED\"},\"sourceDisk\":"
- + "\"projects/project/zones/zone/disks/disks\"}");
-
- }
-
- public void deprecateImage_2xx() throws Exception{
- String imageName = "test-image";
- server.enqueue(jsonResponse("/operation.json"));
-
- DeprecateOptions options = new DeprecateOptions.Builder().state(State.DEPRECATED)
- .replacement(URI.create(url("/projects/centos-cloud/global/images/centos-6-2-v20120326test")))
- .deprecated(new SimpleDateFormatDateService().iso8601DateParse("2014-07-16T22:16:13.468Z"))
- .obsolete(new SimpleDateFormatDateService().iso8601DateParse("2014-10-16T22:16:13.468Z"))
- .deleted(new SimpleDateFormatDateService().iso8601DateParse("2015-01-16T22:16:13.468Z"))
- .build();
-
- assertEquals(imageApi().deprecate(imageName, options),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/images/" + imageName + "/deprecate", stringFromResource("/image_deprecate.json"));
- }
-
- ImageApi imageApi(){
- return api().images();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java
deleted file mode 100644
index 5200c3a..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Instance.AttachedDisk;
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling.OnHostMaintenance;
-import org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput;
-import org.jclouds.googlecomputeengine.domain.Instance.ServiceAccount;
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig;
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.NewInstance;
-import org.jclouds.googlecomputeengine.domain.AttachDisk;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Tags;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.inject.Module;
-
-@Test(groups = "live", testName = "InstanceApiLiveTest")
-public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String INSTANCE_NETWORK_NAME = "instance-api-live-test-network";
- private static final String INSTANCE_NAME = "instance-api-test-instance-1";
- private static final String INSTANCE_NAME2 = "instance-api-test-instance-2";
- private static final String DISK_NAME = "instance-live-test-disk";
- private static final String IPV4_RANGE = "10.0.0.0/8";
- private static final String METADATA_ITEM_KEY = "instanceLiveTestTestProp";
- private static final String METADATA_ITEM_VALUE = "instanceLiveTestTestValue";
- private static final List<String> TAGS = ImmutableList.of("instance-live-test-tag1", "instance-live-test-tag2");
- private static final String ATTACH_DISK_NAME = "instance-api-live-test-attach-disk";
- private static final String ATTACH_DISK_DEVICE_NAME = "attach-disk-1";
- private static final int DEFAULT_DISK_SIZE_GB = 10;
-
- private static final String DEFAULT_BOOT_DISK_NAME = "persistent-disk-0";
-
- private NewInstance instance;
- private NewInstance instance2;
-
- @Override
- protected GoogleComputeEngineApi create(Properties props, Iterable<Module> modules) {
- GoogleComputeEngineApi api = super.create(props, modules);
- List<Image> list = api.images().listInProject("centos-cloud", filter("name eq centos.*")).next();
- URI imageUri = FluentIterable.from(list)
- .filter(new Predicate<Image>() {
- @Override
- public boolean apply(Image input) {
- // filter out all deprecated images
- return !(input.deprecated() != null && input.deprecated().state() != null);
- }
- })
- .first()
- .get()
- .selfLink();
-
- instance = NewInstance.create(
- INSTANCE_NAME, // name
- getDefaultMachineTypeUrl(), // machineType
- getNetworkUrl(INSTANCE_NETWORK_NAME), // network
- Arrays.asList(AttachDisk.newBootDisk(imageUri),
- AttachDisk.existingDisk(getDiskUrl(DISK_NAME))), // disks
- "a description", // description
- Tags.create(null, ImmutableList.of("foo", "bar")) // tags
- );
- instance.metadata().put("mykey", "myvalue");
-
- instance2 = new NewInstance.Builder(INSTANCE_NAME2, // name
- getDefaultMachineTypeUrl(), // machineType
- getNetworkUrl(INSTANCE_NETWORK_NAME), // network
- imageUri) // sourceImage
- .canIpForward(true)
- .description("description")
- .tags(Tags.create(null, ImmutableList.of("tag1")))
- .serviceAccounts(ImmutableList.of(ServiceAccount.create("default", ImmutableList.of("https://www.googleapis.com/auth/compute"))))
- .scheduling(Scheduling.create(OnHostMaintenance.MIGRATE, true))
- .build();
-
- return api;
- }
-
- private InstanceApi api() {
- return api.instancesInZone(DEFAULT_ZONE_NAME);
- }
-
- private DiskApi diskApi() {
- return api.disksInZone(DEFAULT_ZONE_NAME);
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testGetInstance2() {
- Instance instance = api().get(INSTANCE_NAME2);
- assertNotNull(instance);
- assertInstanceEquals(instance, this.instance2);
- assertTrue(instance.canIpForward());
- assertEquals(instance.description(), "description");
- assertEquals(instance.serviceAccounts().get(0).scopes(), ImmutableList.of("https://www.googleapis.com/auth/compute"));
- assertTrue(instance.scheduling().automaticRestart());
- assertEquals(instance.scheduling().onHostMaintenance(), OnHostMaintenance.MIGRATE);
- }
-
- @Test(groups = "live")
- public void testInsertInstance() {
- // need to insert the network first
- assertOperationDoneSuccessfully(api.networks().createInIPv4Range
- (INSTANCE_NETWORK_NAME, IPV4_RANGE));
-
- assertOperationDoneSuccessfully(diskApi().create(DISK_NAME,
- new DiskCreationOptions.Builder().sizeGb(DEFAULT_DISK_SIZE_GB).build()));
- assertOperationDoneSuccessfully(api().create(instance));
- assertOperationDoneSuccessfully(api().create(instance2));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testGetInstance() {
- Instance instance = api().get(INSTANCE_NAME);
- assertNotNull(instance);
- assertInstanceEquals(instance, this.instance);
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testAddAccessConfig() {
- Instance instance = api().get(INSTANCE_NAME);
- assertNotNull(instance);
- assertOperationDoneSuccessfully(api().deleteAccessConfigFromNic(INSTANCE_NAME,
- instance.networkInterfaces().get(0).accessConfigs().get(0).name(), "nic0"));
-
- AccessConfig config = AccessConfig.create("test-config", Type.ONE_TO_ONE_NAT, null);
- assertOperationDoneSuccessfully(api().addAccessConfigToNic(INSTANCE_NAME, config, "nic0"));
- instance = api().get(INSTANCE_NAME);
- assertNotNull(instance);
- assertEquals(instance.networkInterfaces().get(0).accessConfigs().get(0).name(), "test-config");
- }
-
- @Test(groups = "live", dependsOnMethods = "testAddAccessConfig")
- public void testDeleteAccessConfig() {
- Instance instance = api().get(INSTANCE_NAME);
- assertOperationDoneSuccessfully(api().deleteAccessConfigFromNic(INSTANCE_NAME, "test-config", "nic0"));
- instance = api().get(INSTANCE_NAME);
- assertNotNull(instance);
- assertTrue(instance.networkInterfaces().get(0).accessConfigs().isEmpty());
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testGetSerialPortOutput() {
- SerialPortOutput output = api().getSerialPortOutput(INSTANCE_NAME);
- assertNotNull(output);
- assertNotNull(output.selfLink());
- assertNotNull(output.contents());
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testSetDiskAutoDelete() {
-
- assertTrue(existsDiskWithNameAndAutoDelete(INSTANCE_NAME, DEFAULT_BOOT_DISK_NAME, true));
-
- Operation o = api().setDiskAutoDelete(INSTANCE_NAME, DEFAULT_BOOT_DISK_NAME, false);
- assertOperationDoneSuccessfully(o);
-
- assertTrue(existsDiskWithNameAndAutoDelete(INSTANCE_NAME, DEFAULT_BOOT_DISK_NAME, false));
-
- o = api().setDiskAutoDelete(INSTANCE_NAME, DEFAULT_BOOT_DISK_NAME, true);
-
- assertOperationDoneSuccessfully(o);
- assertTrue(existsDiskWithNameAndAutoDelete(INSTANCE_NAME, DEFAULT_BOOT_DISK_NAME, true));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testSetScheduling() {
- Instance instance = api().get(INSTANCE_NAME);
- assertEquals(instance.scheduling().automaticRestart(), true);
- assertEquals(instance.scheduling().onHostMaintenance(), Scheduling.OnHostMaintenance.MIGRATE);
-
- assertOperationDoneSuccessfully(api().setScheduling(INSTANCE_NAME, Scheduling.OnHostMaintenance.TERMINATE, false));
-
- Instance instanceAltered = api().get(INSTANCE_NAME);
- assertEquals(instanceAltered.scheduling().automaticRestart(), false);
- assertEquals(instanceAltered.scheduling().onHostMaintenance(), Scheduling.OnHostMaintenance.TERMINATE);
- }
-
- private boolean existsDiskWithNameAndAutoDelete(String instanceName, final String diskName, final boolean autoDelete){
- Instance revertedInstance = api().get(instanceName);
-
- return Iterables.any(revertedInstance.disks(), new Predicate<AttachedDisk>() {
- @Override
- public boolean apply(AttachedDisk disk) {
- return disk.type() == AttachedDisk.Type.PERSISTENT &&
- diskName.equals(disk.deviceName()) &&
- disk.autoDelete() == autoDelete;
- }
- });
- }
-
- @Test(groups = "live", dependsOnMethods = "testListInstance")
- public void testSetMetadataForInstance() {
- Instance originalInstance = api().get(INSTANCE_NAME);
- Metadata update = Metadata.create(originalInstance.metadata().fingerprint())
- .put(METADATA_ITEM_KEY, METADATA_ITEM_VALUE);
- assertOperationDoneSuccessfully(api().setMetadata(INSTANCE_NAME, update));
-
- Instance modifiedInstance = api().get(INSTANCE_NAME);
-
- assertTrue(modifiedInstance.metadata().containsKey(METADATA_ITEM_KEY));
- assertEquals(modifiedInstance.metadata().get(METADATA_ITEM_KEY), METADATA_ITEM_VALUE);
- assertNotNull(modifiedInstance.metadata().fingerprint());
- }
-
- @Test(groups = "live", dependsOnMethods = "testListInstance")
- public void testSetTagsForInstance() {
- Instance originalInstance = api().get(INSTANCE_NAME);
- assertOperationDoneSuccessfully(
- api().setTags(INSTANCE_NAME, TAGS, originalInstance.tags().fingerprint()));
-
- Instance modifiedInstance = api().get(INSTANCE_NAME);
-
- assertTrue(modifiedInstance.tags().items().containsAll(TAGS));
- assertNotNull(modifiedInstance.tags().fingerprint());
- }
-
- @Test(groups = "live", dependsOnMethods = "testSetMetadataForInstance")
- public void testAttachDiskToInstance() {
- assertOperationDoneSuccessfully(diskApi().create(ATTACH_DISK_NAME,
- new DiskCreationOptions.Builder().sizeGb(1).build()));
-
- Instance originalInstance = api().get(INSTANCE_NAME);
- assertOperationDoneSuccessfully(api().attachDisk(INSTANCE_NAME,
- AttachDisk.create(AttachDisk.Type.PERSISTENT, // type
- AttachDisk.Mode.READ_ONLY, // mode
- getDiskUrl(ATTACH_DISK_NAME), // source
- ATTACH_DISK_DEVICE_NAME, // deviceName
- false, // boot
- null, // initializeParams
- false, // autoDelete
- null, // licenses
- null // interface
- )));
-
- Instance modifiedInstance = api().get(INSTANCE_NAME);
-
- assertTrue(modifiedInstance.disks().size() > originalInstance.disks().size());
- assertTrue(Iterables.any(modifiedInstance.disks(), new Predicate<AttachedDisk>() {
-
- @Override
- public boolean apply(AttachedDisk disk) {
- return disk.type() == AttachedDisk.Type.PERSISTENT &&
- ATTACH_DISK_DEVICE_NAME.equals(disk.deviceName());
- }
- }));
- }
-
- @Test(groups = "live", dependsOnMethods = "testAttachDiskToInstance", alwaysRun = true)
- public void testDetachDiskFromInstance() {
- Instance originalInstance = api().get(INSTANCE_NAME);
- assertOperationDoneSuccessfully(api().detachDisk(INSTANCE_NAME, ATTACH_DISK_DEVICE_NAME));
-
- Instance modifiedInstance = api().get(INSTANCE_NAME);
-
- assertTrue(modifiedInstance.disks().size() < originalInstance.disks().size());
-
- assertOperationDoneSuccessfully(diskApi().delete(ATTACH_DISK_NAME));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertInstance")
- public void testListInstance() {
-
- Iterator<ListPage<Instance>> instances = api().list(filter("name eq " + INSTANCE_NAME));
-
- List<Instance> instancesAsList = instances.next();
-
- assertEquals(instancesAsList.size(), 1);
-
- assertInstanceEquals(instancesAsList.get(0), instance);
- }
-
- @Test(groups = "live", dependsOnMethods = "testDetachDiskFromInstance")
- public void testResetInstance() {
- assertOperationDoneSuccessfully(api().reset(INSTANCE_NAME));
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetInstance2")
- public void testStopInstance() {
- Instance originalInstance = api().get(INSTANCE_NAME2);
- assertEquals(originalInstance.status(), Instance.Status.RUNNING);
- assertOperationDoneSuccessfully(api().stop(INSTANCE_NAME2));
- }
-
- @Test(groups = "live", dependsOnMethods = "testStopInstance")
- public void testStartInstance() {
- Instance originalInstance = api().get(INSTANCE_NAME2);
- assertEquals(originalInstance.status(), Instance.Status.TERMINATED);
- assertOperationDoneSuccessfully(api().start(INSTANCE_NAME2));
- originalInstance = api().get(INSTANCE_NAME2);
- assertEquals(originalInstance.status(), Instance.Status.RUNNING);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testSetDiskAutoDelete", "testResetInstance", "testSetScheduling",
- "testGetInstance", "testGetSerialPortOutput", "testDeleteAccessConfig", "testStartInstance"}, alwaysRun = true)
- public void testDeleteInstance() {
- assertOperationDoneSuccessfully(api().delete(INSTANCE_NAME));
- assertOperationDoneSuccessfully(api().delete(INSTANCE_NAME2));
- assertOperationDoneSuccessfully(diskApi().delete(DISK_NAME));
- Operation deleteNetwork = api.networks().delete(INSTANCE_NETWORK_NAME);
- assertOperationDoneSuccessfully(deleteNetwork);
- }
-
- private void assertInstanceEquals(Instance result, NewInstance expected) {
- assertEquals(result.name(), expected.name());
- assertEquals(result.metadata().asMap(), expected.metadata().asMap()); // ignore fingerprint!
- assertEquals(result.tags().items(), expected.tags().items());
- }
-
- @AfterClass(groups = { "integration", "live" })
- protected void tearDownContext() {
- try {
- waitOperationDone(api().delete(INSTANCE_NAME));
- waitOperationDone(diskApi().delete(DISK_NAME));
- waitOperationDone(api.networks().delete(INSTANCE_NETWORK_NAME));
- } catch (Exception e) {
- // we don't really care about any exception here, so just delete away.
- }
- }
-}
[14/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewInstance.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewInstance.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewInstance.java
deleted file mode 100644
index 2738646..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewInstance.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.domain;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig;
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling;
-import org.jclouds.googlecomputeengine.domain.Instance.ServiceAccount;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableList;
-
-/** Parameter to {@linkplain org.jclouds.googlecomputeengine.features.InstanceApi#create(NewInstance)}. */
-@AutoValue
-public abstract class NewInstance {
- @AutoValue
- abstract static class NetworkInterface {
- abstract URI network();
-
- abstract List<AccessConfig> accessConfigs();
-
- static NetworkInterface create(URI network) {
- return create(network, Arrays.asList(AccessConfig.create(null, Type.ONE_TO_ONE_NAT, null)));
- }
-
- @SerializedNames({ "network", "accessConfigs" })
- static NetworkInterface create(URI network, List<AccessConfig> accessConfigs) {
- return new AutoValue_NewInstance_NetworkInterface(network, accessConfigs);
- }
-
- NetworkInterface() {
- }
- }
-
- public abstract String name();
-
- public abstract URI machineType();
-
- @Nullable public abstract Boolean canIpForward();
-
- public abstract List<NetworkInterface> networkInterfaces();
-
- public abstract List<AttachDisk> disks();
-
- @Nullable public abstract String description();
-
- public abstract Tags tags();
-
- /** Add metadata via {@link Metadata#items()}. */
- public abstract Metadata metadata();
-
- @Nullable public abstract List<ServiceAccount> serviceAccounts();
-
- @Nullable public abstract Scheduling scheduling();
-
- /** Convenience for creating a new instance with only a boot disk and minimal parameters. */
- public static NewInstance create(String name, URI machineType, URI network, URI sourceImage) {
- return create(name, machineType, network, Arrays.asList(AttachDisk.newBootDisk(sourceImage)), null, null);
- }
-
- public static NewInstance create(String name, URI machineType, URI network, List<AttachDisk> disks,
- @Nullable String description, @Nullable Tags tags) {
- checkArgument(disks.get(0).boot(), "disk 0 must be a boot disk! %s", disks);
- boolean foundBoot = false;
- for (AttachDisk disk : disks) {
- if (disk.boot()) {
- checkArgument(!foundBoot, "There must be only one boot disk! %s", disks);
- foundBoot = true;
- }
- }
- return create(name, machineType, null, ImmutableList.of(NetworkInterface.create(network)), ImmutableList.copyOf(disks),
- description, tags != null ? tags : Tags.create(), Metadata.create(), null, null);
- }
-
- @SerializedNames({ "name", "machineType", "canIpForward", "networkInterfaces", "disks", "description",
- "tags", "metadata", "serviceAccounts", "scheduling" })
- static NewInstance create(String name, URI machineType, Boolean canIpForward,
- List<NetworkInterface> networkInterfaces, List<AttachDisk> disks, String description,
- Tags tags, Metadata metadata, List<ServiceAccount> serviceAccounts, Scheduling scheduling) {
- return new AutoValue_NewInstance(name, machineType, canIpForward, networkInterfaces, disks, description,
- tags, metadata, serviceAccounts, scheduling);
- }
-
- NewInstance() {
- }
-
- public static class Builder {
- private String name;
- private URI machineType;
- private Boolean canIpForward;
- private List<NetworkInterface> networkInterfaces;
- private List<AttachDisk> disks;
- private String description;
- private Tags tags;
- private Metadata metadata;
- private List<ServiceAccount> serviceAccounts;
- private Scheduling scheduling;
-
- public Builder(String name, URI machineType, URI network, List<AttachDisk> disks) {
- checkNotNull(name, "NewInstance name cannot be null");
- this.name = name;
- this.machineType = machineType;
- this.networkInterfaces = ImmutableList.of(NetworkInterface.create(network));
- this.disks = disks;
- }
-
- public Builder(String name, URI machineType, URI network, URI sourceImage) {
- checkNotNull(name, "NewInstance name cannot be null");
- this.name = name;
- this.machineType = machineType;
- this.networkInterfaces = ImmutableList.of(NetworkInterface.create(network));
- this.disks = Arrays.asList(AttachDisk.newBootDisk(sourceImage));
- }
-
- public Builder canIpForward(Boolean canIpForward){
- this.canIpForward = canIpForward;
- return this;
- }
-
- public Builder description(String description){
- this.description = description;
- return this;
- }
-
- public Builder tags(Tags tags){
- this.tags = tags;
- return this;
- }
-
- public Builder metadata(Metadata metadata){
- this.metadata = metadata;
- return this;
- }
-
- /**
- * A list of service accounts, with their specified scopes, authorized for this instance.
- * Service accounts generate access tokens that can be accessed through the metadata server
- * and used to authenticate applications on the instance.
- * Note: to add scopes to the default service account on the VM you can use 'default' as
- * a keyword for email.
- */
- public Builder serviceAccounts(List<ServiceAccount> serviceAccounts){
- this.serviceAccounts = serviceAccounts;
- return this;
- }
-
- public Builder scheduling(Scheduling scheduling){
- this.scheduling = scheduling;
- return this;
- }
-
- public NewInstance build() {
- return create(name, machineType, canIpForward, networkInterfaces, disks, description, tags != null ? tags : Tags.create(),
- metadata != null ? metadata : Metadata.create(), serviceAccounts, scheduling);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewTargetInstance.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewTargetInstance.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewTargetInstance.java
deleted file mode 100644
index 478bfce..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/NewTargetInstance.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.domain;
-
-import java.net.URI;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class NewTargetInstance {
-
- public abstract String name();
- @Nullable public abstract String description();
- @Nullable public abstract String natPolicy();
- @Nullable public abstract URI instance();
-
- @SerializedNames({"name", "description", "natPolicy", "instance"})
- static NewTargetInstance create(String name, String description, String natPolicy, URI instance){
- return new AutoValue_NewTargetInstance(name, description, natPolicy, instance);
- }
-
- NewTargetInstance() {
- }
-
- public static class Builder {
- private String name;
- private String description;
- private String natPolicy;
- private URI instance;
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder natPolicy(String natPolicy) {
- this.natPolicy = natPolicy;
- return this;
- }
-
- public Builder instance(URI instance) {
- this.instance = instance;
- return this;
- }
-
- public NewTargetInstance build() {
- return NewTargetInstance.create(name, description, natPolicy, instance);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java
deleted file mode 100644
index b36dc64..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java
+++ /dev/null
@@ -1,148 +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.domain;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Operation {
-
- @AutoValue
- public abstract static class Error {
-
- @AutoValue
- public abstract static class Entry {
-
- /** The error type identifier for this error. */
- public abstract String code(); // TODO: enum?
-
- /** The field in the request which caused the error. */
- @Nullable public abstract String location();
-
- @Nullable public abstract String message();
-
- @SerializedNames({ "code", "location", "message" })
- public static Entry create(String code, String location, String message) {
- return new AutoValue_Operation_Error_Entry(code, location, message);
- }
-
- Entry() {
- }
- }
-
- public abstract List<Entry> errors();
-
- @SerializedNames({ "errors" })
- public static Error create(List<Entry> errors) {
- return new AutoValue_Operation_Error(errors != null ? errors : new ArrayList<Entry>());
- }
-
- public static Error empty(){
- return create(null);
- }
-
- Error(){
- }
- }
-
- public static enum Status {
- PENDING,
- RUNNING,
- DONE
- }
-
- public abstract String id();
-
- @Nullable public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /** URL of the resource the operation is mutating. */
- public abstract URI targetLink();
-
- /** Target id which identifies a particular incarnation of the target. */
- @Nullable public abstract String targetId();
-
- /**
- * Identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in
- * the project.
- */
- @Nullable public abstract String clientOperationId();
-
- public abstract Status status();
-
- /** Textual description of the current status of the operation. */
- @Nullable public abstract String statusMessage();
-
- /** User who requested the operation, for example {@code user@example.com}. */
- @Nullable public abstract String user();
-
- /**
- * A progress indicator that ranges from 0 to 100. This should not be used to guess at when the
- * operation will be complete. This number should be monotonically increasing as the operation progresses.
- */
- @Nullable public abstract Integer progress(); // TODO: check really nullable
-
- /** The time that this operation was requested. */
- public abstract Date insertTime();
-
- @Nullable public abstract Date startTime();
-
- @Nullable public abstract Date endTime();
-
- @Nullable public abstract Integer httpErrorStatusCode();
-
- @Nullable public abstract String httpErrorMessage();
-
- /** Examples include insert, update, and delete. */
- public abstract String operationType(); // TODO: enum
-
- public abstract Error error();
-
- @Nullable public abstract List<Warning> warnings();
-
- @Nullable public abstract URI region();
-
- @Nullable public abstract URI zone();
-
- @SerializedNames({ "id", "creationTimestamp", "selfLink", "name", "description", "targetLink", "targetId", "clientOperationId", "status",
- "statusMessage", "user", "progress", "insertTime", "startTime", "endTime", "httpErrorStatusCode",
- "httpErrorMessage", "operationType", "error", "warnings", "region", "zone" })
- public static Operation create(String id, Date creationTimestamp, URI selfLink, String name, String description, URI targetLink,
- String targetId, String clientOperationId, Status status, String statusMessage, String user, Integer progress,
- Date insertTime, Date startTime, Date endTime, Integer httpErrorStatusCode, String httpErrorMessage,
- String operationType, Error error, List<Warning> warnings, URI region, URI zone) {
- return new AutoValue_Operation(id, creationTimestamp, selfLink, name, description, targetLink, targetId, clientOperationId, status,
- statusMessage, user, progress, insertTime, startTime, endTime, httpErrorStatusCode, httpErrorMessage,
- operationType, error != null ? error : Error.empty(), warnings, region, zone);
- }
-
- Operation() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Project.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Project.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Project.java
deleted file mode 100644
index ecec9e4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Project.java
+++ /dev/null
@@ -1,80 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/** The root collection and settings resource for all Google Compute Engine resources. */
-@AutoValue
-public abstract class Project {
-
- @AutoValue
- public abstract static class UsageExportLocation {
-
- public abstract String bucketName();
-
- public abstract String reportNamePrefix();
-
- @SerializedNames({"bucketName", "reportNamePrefix"})
- public static UsageExportLocation create(String bucketName, String reporNamePrefix) {
- return new AutoValue_Project_UsageExportLocation(bucketName, reporNamePrefix);
- }
-
- UsageExportLocation () {
- }
- }
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /** Key/value pairs available to all instances contained in this project. */
- public abstract Metadata commonInstanceMetadata();
-
- public abstract List<Quota> quotas();
-
- /** Available IP addresses available for use in this project. */
- public abstract List<String> externalIpAddresses();
-
- public abstract Date creationTimestamp();
-
- @Nullable public abstract UsageExportLocation usageExportLocation();
-
- @SerializedNames(
- { "id", "selfLink", "name", "description", "commonInstanceMetadata", "quotas", "externalIpAddresses", "creationTimestamp", "usageExportLocation"})
- public static Project create(String id, URI selfLink, String name, String description,
- Metadata commonInstanceMetadata, List<Quota> quotas, List<String> externalIpAddresses, Date creationTimestamp, UsageExportLocation usageExportLocation) {
- return new AutoValue_Project(id, selfLink, name, description, commonInstanceMetadata, copyOf(quotas),
- copyOf(externalIpAddresses), creationTimestamp, usageExportLocation);
- }
-
- Project() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java
deleted file mode 100644
index b1cbad5..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java
+++ /dev/null
@@ -1,41 +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.domain;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/** Quotas assigned to a given project or region. */
-@AutoValue
-public abstract class Quota {
-
- @Nullable public abstract String metric(); // Nullable?! really?!
-
- public abstract double usage();
-
- public abstract double limit();
-
- @SerializedNames({ "metric", "usage", "limit" })
- public static Quota create(String metric, double usage, double limit) {
- return new AutoValue_Quota(metric, usage, limit);
- }
-
- Quota() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java
deleted file mode 100644
index 91d4cf1..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java
+++ /dev/null
@@ -1,62 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Region {
-
- public enum Status {
- UP,
- DOWN
- }
-
- public abstract String id();
-
- public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract Status status();
-
- public abstract List<URI> zones();
-
- public abstract List<Quota> quotas();
-
- @SerializedNames({ "id", "creationTimestamp", "selfLink", "name", "description", "status", "zones", "quotas" })
- public static Region create(String id, Date creationTimestamp, URI selfLink, String name, String description, Status status, List<URI> zones,
- List<Quota> quotas) {
- return new AutoValue_Region(id, creationTimestamp, selfLink, name, description, status, copyOf(zones), copyOf(quotas));
- }
-
- Region() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java
deleted file mode 100644
index a99d0fd..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java
+++ /dev/null
@@ -1,88 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Route {
-
- public abstract String id();
-
- public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract URI network();
-
- /** The set of instance items to which this route applies. */
- public abstract List<String> tags();
-
- /** The destination range of outgoing packets that this route applies to. */
- public abstract String destRange();
-
- /**
- * The priority of this route. Priority is used to break ties in the case
- * where there is more than one matching route of maximum length. A lower value
- * is higher priority; a priority of 100 is higher than 200.
- */
- public abstract int priority();
-
- /** The fully-qualified URL to an instance that should handle matching packets. */
- @Nullable public abstract URI nextHopInstance();
-
- /** The network IP address of an instance that should handle matching packets. */
- @Nullable public abstract String nextHopIp();
-
- /** The local network if it should handle matching packets. */
- @Nullable public abstract URI nextHopNetwork();
-
- /** The gateway that should handle matching packets. Currently, this is only the internet gateway. */
- @Nullable public abstract URI nextHopGateway();
-
- /** Potential misconfigurations are detected for this route. */
- public abstract List<Warning> warnings();
-
- /** The URL to a VpnTunnel that should handle matching packets. */
- @Nullable public abstract URI nextHopVpnTunnel();
-
- @SerializedNames(
- { "id", "creationTimestamp", "selfLink", "name", "description", "network", "tags", "destRange", "priority", "nextHopInstance",
- "nextHopIp", "nextHopNetwork", "nextHopGateway", "warnings", "nextHopVpnTunnel" })
- public static Route create(String id, Date creationTimestamp, URI selfLink, String name, String description, URI network, List<String> tags,
- String destRange, int priority, URI nextHopInstance, String nextHopIp, URI nextHopNetwork, URI nextHopGateway,
- List<Warning> warnings, URI nextHopVpnTunnel) {
- return new AutoValue_Route(id, creationTimestamp, selfLink, name, description, network, copyOf(tags), destRange, priority,
- nextHopInstance, nextHopIp, nextHopNetwork, nextHopGateway, copyOf(warnings), nextHopVpnTunnel);
- }
-
- Route() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java
deleted file mode 100644
index 50b7356..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java
+++ /dev/null
@@ -1,75 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Snapshot {
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract Date creationTimestamp();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract int diskSizeGb();
-
- public abstract String status();
-
- /**
- * The source disk used to insert this snapshot. Once the source disk
- * has been deleted from the system, this field will be cleared, and will
- * not be set even if a disk with the same name has been re-created (output only).
- */
- @Nullable public abstract URI sourceDisk();
-
- /**
- * The ID value of the disk used to insert this snapshot. This value
- * may be used to determine whether the snapshot was taken from the current
- * or a previous instance of a given disk name.
- */
- public abstract String sourceDiskId();
-
- @Nullable public abstract Long storageBytes();
-
- @Nullable public abstract String storageByteStatus();
-
- @Nullable public abstract List<String> licenses();
-
- @SerializedNames({ "id", "selfLink", "creationTimestamp", "name", "description", "diskSizeGb", "status",
- "sourceDisk", "sourceDiskId", "storageBytes", "storageByteStatus", "licenses" })
- public static Snapshot create(String id, URI selfLink, Date creationTimestamp, String name, String description,
- int diskSizeGb, String status, URI sourceDisk, String sourceDiskId, Long storageBytes, String storageByteStatus, List<String> licenses) {
- return new AutoValue_Snapshot(id, selfLink, creationTimestamp, name, description, diskSizeGb, status,
- sourceDisk, sourceDiskId, storageBytes, storageByteStatus, licenses);
- }
-
- Snapshot() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Tags.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Tags.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Tags.java
deleted file mode 100644
index 59f3071..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Tags.java
+++ /dev/null
@@ -1,55 +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.domain;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableList;
-
-/**
- * Tags for an instance or project, with their fingerprint. Each tag must be unique, must be 1-63 characters long, and
- * comply with RFC1035.
- * <p/>
- * This object is mutable and not thread-safe.
- */
-@AutoValue
-public abstract class Tags implements Cloneable {
- /** The fingerprint for the items - needed for updating them. */
- @Nullable public abstract String fingerprint();
-
- /** Immutable list of tags. */
- public abstract ImmutableList<String> items();
-
- public static Tags create() {
- return Tags.create(null, null);
- }
-
- @SerializedNames({ "fingerprint", "items" })
- public static Tags create(String fingerprint, ImmutableList<String> items) { // Dictates the type when created from json!
- ImmutableList<String> empty = ImmutableList.of();
- return new AutoValue_Tags(fingerprint, items != null ? items : empty);
- }
-
- Tags() {
- }
-
- @Override public Tags clone() {
- return Tags.create(fingerprint(), items());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetHttpProxy.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetHttpProxy.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetHttpProxy.java
deleted file mode 100644
index 89014ab..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetHttpProxy.java
+++ /dev/null
@@ -1,47 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-import com.google.common.annotations.Beta;
-
-@AutoValue
-@Beta
-public abstract class TargetHttpProxy {
-
- public abstract String id();
- public abstract Date creationTimestamp();
- public abstract URI selfLink();
- public abstract String name();
- @Nullable public abstract String description();
- public abstract URI urlMap();
-
- @SerializedNames({"id", "creationTimestamp", "selfLink", "name", "description", "urlMap"})
- public static TargetHttpProxy create(String id, Date creationTimestamp, URI selfLink, String name,
- @Nullable String description, URI urlMap){
- return new AutoValue_TargetHttpProxy(id, creationTimestamp, selfLink, name, description, urlMap);
- }
-
- TargetHttpProxy(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetInstance.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetInstance.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetInstance.java
deleted file mode 100644
index f477572..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetInstance.java
+++ /dev/null
@@ -1,49 +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.domain;
-
-
-import java.net.URI;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class TargetInstance {
-
- public abstract String id();
- public abstract String creationTimestamp();
- public abstract String name();
- @Nullable public abstract String description();
- public abstract URI zone();
- public abstract String natPolicy();
- @Nullable public abstract URI instance();
- public abstract URI selfLink();
-
- @SerializedNames({"id", "creationTimestamp", "name", "description", "zone",
- "natPolicy", "instance", "selfLink"})
- public static TargetInstance create(String id, String creationTimestamp, String name,
- String description, URI zone, String natPolicy, URI instance, URI selfLink){
- return new AutoValue_TargetInstance(id, creationTimestamp, name, description, zone,
- natPolicy, instance, selfLink);
- }
-
- TargetInstance(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetPool.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetPool.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetPool.java
deleted file mode 100644
index 4fa447b..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/TargetPool.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions.SessionAffinityValue;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class TargetPool {
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract Date creationTimestamp();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract URI region();
-
- /**
- * URL to HttpHealthCheck resources. A member VM in this pool is considered healthy if and only if
- * the specified health checks pass. An empty list means all member virtual machines will be considered healthy at
- * all times but the health status of this target pool will be marked as unhealthy to indicate that no health checks
- * are being performed.
- */
- public abstract List<URI> healthChecks();
-
- /**
- * A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same
- * region as this pool.
- */
- public abstract List<URI> instances();
-
- /**
- * The session affinity option, determines the hash method that Google Compute Engine uses to
- * distribute traffic.
- */
- @Nullable public abstract SessionAffinityValue sessionAffinity();
-
- /**
- * This field is applicable only when the target pool is serving a forwarding rule as the primary pool.
- * The value of the a float between [0, 1]. If set, backupPool must also be set. Together,
- * they define the fallback behavior of the primary target pool. If the ratio of the healthy VMs in the primary
- * pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool.
- * In case where failoverRatio is not set or all the VMs in the backup pool are unhealthy,
- * the traffic will be directed back to the primary pool in the force mode, where traffic will be spread to the
- * healthy VMs with the best effort, or to all VMs when no VM is healthy.
- */
- @Nullable public abstract Float failoverRatio();
-
- /**
- * This field is applicable only when the target pool is serving a forwarding rule as the primary pool.
- * Must be a fully-qualified URL to a target pool that is in the same region as the primary target pool.
- * If set, failoverRatio must also be set. Together, they define the fallback behavior of the primary target pool.
- * If the ratio of the healthy VMs in the primary pool is at or below this number,
- * traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is
- * not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool
- * in the force mode, where traffic will be spread to the healthy VMs with the best effort,
- * or to all VMs when no VM is healthy.
- */
- @Nullable public abstract URI backupPool();
-
- @SerializedNames({ "id", "selfLink", "creationTimestamp", "name", "description", "region", "healthChecks", "instances", "sessionAffinity",
- "failoverRatio", "backupPool" })
- public static TargetPool create(String id, URI selfLink, Date creationTimestamp, String name, String description, URI region,
- List<URI> healthChecks, List<URI> instances, SessionAffinityValue sessionAffinity, Float failoverRatio,
- URI backupPool) {
- return new AutoValue_TargetPool(id, selfLink, creationTimestamp, name, description, region, copyOf(healthChecks), copyOf(instances),
- sessionAffinity, failoverRatio, backupPool);
- }
-
- TargetPool() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMap.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMap.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMap.java
deleted file mode 100644
index 79a7993..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMap.java
+++ /dev/null
@@ -1,125 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class UrlMap {
-
- /**
- * An urlMap hostRule used to filter requests based on hostname. Controls what traffic is sent to
- * which path matcher.
- */
- @AutoValue
- public abstract static class HostRule {
- @Nullable public abstract String description();
- public abstract List<String> hosts();
- public abstract String pathMatcher();
-
- @SerializedNames({ "description", "hosts", "pathMatcher" })
- public static HostRule create(String description, List<String> hosts,
- String pathMatcher) {
- return new AutoValue_UrlMap_HostRule(description, hosts, pathMatcher);
- }
-
- HostRule(){
- }
- }
-
- @AutoValue
- public abstract static class PathMatcher {
-
- @AutoValue
- public abstract static class PathRule{
- public abstract List<String> paths();
- public abstract URI service();
-
- @SerializedNames({"paths", "service"})
- public static PathRule create(List<String> paths, URI service) {
- return new AutoValue_UrlMap_PathMatcher_PathRule(paths, service);
- }
-
- PathRule(){
- }
- }
-
- public abstract String name();
- @Nullable public abstract String description();
- public abstract URI defaultService();
- public abstract List<PathRule> pathRules();
-
- @SerializedNames({ "name", "description", "defaultService", "pathRules" })
- public static PathMatcher create(String name, @Nullable String description,
- URI defaultService, @Nullable List<PathRule> pathRules) {
- return new AutoValue_UrlMap_PathMatcher(name, description, defaultService, pathRules);
- }
-
- PathMatcher(){
- }
- }
-
- @AutoValue
- public abstract static class UrlMapTest{
-
- @Nullable public abstract String description();
- public abstract String host();
- public abstract String path();
- public abstract URI service();
-
- @SerializedNames({"description", "host", "path", "service"})
- public static UrlMapTest create(@Nullable String description, String host, String path, URI service) {
- return new AutoValue_UrlMap_UrlMapTest(description, host, path, service);
- }
- UrlMapTest(){
- }
- }
-
- public abstract String id();
- public abstract Date creationTimestamp();
- public abstract URI selfLink();
- public abstract String name();
- @Nullable public abstract String description();
- @Nullable public abstract List<HostRule> hostRules();
- @Nullable public abstract List<PathMatcher> pathMatchers();
- @Nullable public abstract List<UrlMapTest> urlMapTests();
- public abstract URI defaultService();
- public abstract String fingerprint();
-
-
- @SerializedNames({
- "id", "creationTimestamp", "selfLink", "name", "description", "hostRules", "pathMatchers",
- "tests", "defaultService", "fingerprint"})
- public static UrlMap create (String id, Date creationTimestamp, URI selfLink, String name,
- @Nullable String description, @Nullable List<HostRule> hostRules,
- @Nullable List<PathMatcher> pathMatchers,
- @Nullable List<UrlMapTest> urlMapTests, URI defaultService,
- @Nullable String fingerprint) {
- return new AutoValue_UrlMap(id, creationTimestamp, selfLink, name, description, hostRules, pathMatchers,
- urlMapTests, defaultService, fingerprint);
- }
-
- UrlMap(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMapValidateResult.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMapValidateResult.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMapValidateResult.java
deleted file mode 100644
index a33e7d0..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/UrlMapValidateResult.java
+++ /dev/null
@@ -1,84 +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.domain;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class UrlMapValidateResult {
-
- public abstract UrlMapValidateResultInternal result();
-
- @SerializedNames({"result"})
- public static UrlMapValidateResult create(UrlMapValidateResultInternal result){
- return new AutoValue_UrlMapValidateResult(result);
- }
-
- @SerializedNames({"loadSucceeded", "loadErrors", "testPassed", "testFailures"})
- public static UrlMapValidateResult create(Boolean loadSucceeded, List<String> loadErrors,
- Boolean testPassed, List<UrlMapValidateResultInternal.TestFailure> testFailures) {
- return create(UrlMapValidateResultInternal.create(loadSucceeded, loadErrors, testPassed, testFailures));
- }
-
- public static UrlMapValidateResult allPass(){
- return create(true, null, true, null);
- }
-
- @AutoValue
- public abstract static class UrlMapValidateResultInternal {
-
- public abstract Boolean loadSucceeded();
- @Nullable public abstract List<String> loadErrors();
- @Nullable public abstract Boolean testPassed();
- @Nullable public abstract List<TestFailure> testFailures();
-
- @SerializedNames({"loadSucceeded", "loadErrors", "testPassed", "testFailures"})
- public static UrlMapValidateResultInternal create(Boolean loadSucceeded, List<String> loadErrors,
- Boolean testPassed, List<TestFailure> testFailures) {
- return new AutoValue_UrlMapValidateResult_UrlMapValidateResultInternal(loadSucceeded, loadErrors, testPassed, testFailures);
- }
-
- UrlMapValidateResultInternal(){
- }
-
- @AutoValue
- public abstract static class TestFailure {
-
- public abstract String host();
- public abstract String path();
- public abstract URI expectedService();
- public abstract URI actualService();
-
- @SerializedNames({"host", "path", "expectedService", "actualService"})
- public static TestFailure create(String host, String path, URI expectedService, URI actualService){
- return new AutoValue_UrlMapValidateResult_UrlMapValidateResultInternal_TestFailure(host, path, expectedService, actualService);
- }
-
- TestFailure(){
- }
- }
- }
-
- UrlMapValidateResult(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Warning.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Warning.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Warning.java
deleted file mode 100644
index ec2f4b9..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Warning.java
+++ /dev/null
@@ -1,40 +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.domain;
-
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Warning {
-
- public abstract String code();
- @Nullable public abstract String message();
- public abstract List<KeyValuePair> data();
-
- @SerializedNames({"code", "message", "data"})
- public static Warning create(String code, String message, List<KeyValuePair> data){
- return new AutoValue_Warning(code, message, data);
- }
-
- Warning() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java
deleted file mode 100644
index 70f9fb6..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java
+++ /dev/null
@@ -1,97 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Zone {
-
- /**
- * Scheduled maintenance windows for the zone. When the zone is in a maintenance window,
- * all resources which reside in the zone will be unavailable.
- */
- @AutoValue
- public abstract static class MaintenanceWindow {
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract Date beginTime();
-
- public abstract Date endTime();
-
- @SerializedNames({ "name", "description", "beginTime", "endTime" })
- public static MaintenanceWindow create(String name, String description, Date beginTime, Date endTime) {
- return new AutoValue_Zone_MaintenanceWindow(name, description, beginTime, endTime);
- }
-
- MaintenanceWindow() {
- }
- }
-
- public enum Status {
- UP,
- DOWN
- }
-
- public abstract String id();
-
- public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract Status status();
-
- /**
- * Scheduled maintenance windows for the zone. When the zone is in a maintenance window,
- * all resources which reside in the zone will be unavailable.
- */
- public abstract List<MaintenanceWindow> maintenanceWindows();
-
- @Nullable public abstract Deprecated deprecated();
-
- public abstract String region();
-
- /** The machine types that can be used in this zone. */
- public abstract List<String> availableMachineTypes();
-
- @SerializedNames(
- { "id", "creationTimestamp", "selfLink", "name", "description", "status", "maintenanceWindows", "deprecated", "region", "availableMachineTypes" })
- public static Zone create(String id, Date creationTimestamp, URI selfLink, String name, String description, Status status,
- List<MaintenanceWindow> maintenanceWindows, Deprecated deprecated, String region, List<String> availableMachineTypes) {
- return new AutoValue_Zone(id, creationTimestamp, selfLink, name, description, status, copyOf(maintenanceWindows), deprecated, region,
- copyOf(availableMachineTypes));
- }
-
- Zone() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java
deleted file mode 100644
index 801fb41..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.AddressCreationOptions;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/addresses")
-@Consumes(APPLICATION_JSON)
-public interface AddressApi {
-
- /** Returns an address by name or null if not found. */
- @Named("Addresses:get")
- @GET
- @Path("/{address}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Address get(@PathParam("address") String address);
-
- /**
- * Creates an address resource in the specified project specifying the size of the address.
- *
- * @param address the name of address.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Addresses:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation create(@PayloadParam("name") String address);
-
- /** @see #create(String) */
- @Named("Addresses:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) AddressCreationOptions options);
-
- /** Deletes an address by name and returns the operation in progress, or null if not found. */
- @Named("Addresses:delete")
- @DELETE
- @Path("/{address}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("address") String address);
-
- /**
- * Retrieves the list of address resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Addresses:list")
- @GET
- ListPage<Address> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Addresses:list")
- @GET
- @Transform(AddressPages.class)
- Iterator<ListPage<Address>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Addresses:list")
- @GET
- @Transform(AddressPages.class)
- Iterator<ListPage<Address>> list(ListOptions options);
-
- static final class AddressPages extends BaseCallerArg0ToIteratorOfListPage<Address, AddressPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject AddressPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Address>> fetchNextPage(final String regionName, final ListOptions options) {
- return new Function<String, ListPage<Address>>() {
- @Override public ListPage<Address> apply(String pageToken) {
- return api.addressesInRegion(regionName).listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AggregatedListApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AggregatedListApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AggregatedListApi.java
deleted file mode 100644
index a663e42..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AggregatedListApi.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.TargetInstance;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({ '/', '=' })
-@RequestFilters(OAuthFilter.class)
-@Path("/aggregated")
-@Consumes(APPLICATION_JSON)
-public interface AggregatedListApi {
-
- /**
- * Retrieves the list of machine type resources available to the specified
- * project. By default the list as a maximum size of 100, if no options are
- * provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("MachineTypes:aggregatedList")
- @GET
- @Path("/machineTypes")
- ListPage<MachineType> pageOfMachineTypes(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #pageOfMachineTypes(String, ListOptions) */
- @Named("MachineTypes:aggregatedList")
- @GET
- @Path("/machineTypes")
- @Transform(MachineTypePages.class)
- Iterator<ListPage<MachineType>> machineTypes();
-
- /** @see #pageOfMachineTypes(String, ListOptions) */
- @Named("MachineTypes:aggregatedList")
- @GET
- @Path("/machineTypes")
- @Transform(MachineTypePages.class)
- Iterator<ListPage<MachineType>> machineTypes(ListOptions options);
-
- static final class MachineTypePages extends BaseToIteratorOfListPage<MachineType, MachineTypePages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- MachineTypePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<MachineType>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<MachineType>>() {
- @Override
- public ListPage<MachineType> apply(String pageToken) {
- return api.aggregatedList().pageOfMachineTypes(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of instance resources available to the specified
- * project. By default the list as a maximum size of 100, if no options are
- * provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("Instances:aggregatedList")
- @GET
- @Path("/instances")
- ListPage<Instance> pageOfInstances(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #pageOfInstances(String, ListOptions) */
- @Named("Instances:aggregatedList")
- @GET
- @Path("/instances")
- @Transform(InstancePages.class)
- Iterator<ListPage<Instance>> instances();
-
- /** @see #pageOfInstances(String, ListOptions) */
- @Named("Instances:aggregatedList")
- @GET
- @Path("/instances")
- @Transform(InstancePages.class)
- Iterator<ListPage<Instance>> instances(ListOptions options);
-
- static final class InstancePages extends BaseToIteratorOfListPage<Instance, InstancePages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- InstancePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Instance>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Instance>>() {
- @Override
- public ListPage<Instance> apply(String pageToken) {
- return api.aggregatedList().pageOfInstances(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of address resources available to the specified
- * project. By default the list as a maximum size of 100, if no options are
- * provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("Addresses:aggregatedList")
- @GET
- @Path("/addresses")
- ListPage<Address> pageOfAddresses(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #pageOfAddresses(String, ListOptions) */
- @Named("Addresses:aggregatedList")
- @GET
- @Path("/addresses")
- @Transform(AddressPages.class)
- Iterator<ListPage<Address>> addresses();
-
- /** @see #pageOfAddresses(String, ListOptions) */
- @Named("Addresses:aggregatedList")
- @GET
- @Path("/addresses")
- @Transform(AddressPages.class)
- Iterator<ListPage<Address>> addresses(ListOptions options);
-
- static final class AddressPages extends BaseToIteratorOfListPage<Address, AddressPages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- AddressPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Address>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Address>>() {
- @Override
- public ListPage<Address> apply(String pageToken) {
- return api.aggregatedList().pageOfAddresses(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of disk resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided
- * or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("Disks:aggregatedList")
- @GET
- @Path("/disks")
- ListPage<Disk> pageOfDisks(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #pageOfDisks(String, ListOptions) */
- @Named("Disks:aggregatedList")
- @GET
- @Path("/disks")
- @Transform(DiskPages.class)
- Iterator<ListPage<Disk>> disks();
-
- /** @see #pageOfDisks(String, ListOptions) */
- @Named("Disks:aggregatedList")
- @GET
- @Path("/disks")
- @Transform(DiskPages.class)
- Iterator<ListPage<Disk>> disks(ListOptions options);
-
- static final class DiskPages extends BaseToIteratorOfListPage<Disk, DiskPages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- DiskPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Disk>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Disk>>() {
- @Override
- public ListPage<Disk> apply(String pageToken) {
- return api.aggregatedList().pageOfDisks(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of disk type resources available to the specified
- * project. By default the list as a maximum size of 100, if no options are
- * provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("DiskTypes:aggregatedList")
- @GET
- @Path("/diskTypes")
- ListPage<DiskType> pageOfDiskTypes(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #pageOfDiskTypes(String, ListOptions) */
- @Named("DiskTypes:aggregatedList")
- @GET
- @Path("/diskTypes")
- @Transform(DiskTypePages.class)
- Iterator<ListPage<DiskType>> diskTypes();
-
- /** @see #pageOfDiskTypes(String, ListOptions) */
- @Named("DiskTypes:aggregatedList")
- @GET
- @Path("/diskTypes")
- @Transform(DiskTypePages.class)
- Iterator<ListPage<DiskType>> diskTypes(ListOptions options);
-
- static final class DiskTypePages extends BaseToIteratorOfListPage<DiskType, DiskTypePages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- DiskTypePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<DiskType>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<DiskType>>() {
- @Override
- public ListPage<DiskType> apply(String pageToken) {
- return api.aggregatedList().pageOfDiskTypes(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of global operations resources available to the
- * specified project. By default the list as a maximum size of 100, if no
- * options are provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("GlobalOperations:aggregatedList")
- @GET
- @Path("/operations")
- ListPage<Operation> pageOfGlobalOperations(@Nullable @QueryParam("pageToken") String pageToken,
- ListOptions listOptions);
-
- /** @see #pageOfGlobalOperations(String, ListOptions) */
- @Named("GlobalOperations:aggregatedList")
- @GET
- @Path("/operations")
- @Transform(OperationPages.class)
- Iterator<ListPage<Operation>> globalOperations();
-
- /** @see #pageOfGlobalOperations(String, ListOptions) */
- @Named("GlobalOperations:aggregatedList")
- @GET
- @Path("/operations")
- @Transform(OperationPages.class)
- Iterator<ListPage<Operation>> globalOperations(ListOptions options);
-
- static final class OperationPages extends BaseToIteratorOfListPage<Operation, OperationPages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- OperationPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<Operation>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Operation>>() {
- @Override
- public ListPage<Operation> apply(String pageToken) {
- return api.aggregatedList().pageOfGlobalOperations(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of forwarding rule resources available to the
- * specified project. By default the list as a maximum size of 100, if no
- * options are provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("ForwardingRules:aggregatedList")
- @GET
- @Path("/forwardingRules")
- ListPage<ForwardingRule> pageOfForwardingRules(@Nullable @QueryParam("pageToken") String pageToken,
- ListOptions listOptions);
-
- /** @see #pageOfForwardingRules(String, ListOptions) */
- @Named("ForwardingRules:aggregatedList")
- @GET
- @Path("/forwardingRules")
- @Transform(ForwardingRulePages.class)
- Iterator<ListPage<ForwardingRule>> forwardingRules();
-
- /** @see #pageOfForwardingRules(String, ListOptions) */
- @Named("ForwardingRule:aggregatedList")
- @GET
- @Path("/forwardingRules")
- @Transform(ForwardingRulePages.class)
- Iterator<ListPage<ForwardingRule>> forwardingRules(ListOptions options);
-
- static final class ForwardingRulePages extends BaseToIteratorOfListPage<ForwardingRule, ForwardingRulePages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- ForwardingRulePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<ForwardingRule>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<ForwardingRule>>() {
- @Override
- public ListPage<ForwardingRule> apply(String pageToken) {
- return api.aggregatedList().pageOfForwardingRules(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of TargetInstance resources available to the
- * specified project. By default the list as a maximum size of 100, if no
- * options are provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("TargetInstances:aggregatedList")
- @GET
- @Path("/targetInstances")
- ListPage<TargetInstance> pageOfTargetInstances(@Nullable @QueryParam("pageToken") String pageToken,
- ListOptions listOptions);
-
- /** @see #pageOfTargetInstances(String, ListOptions) */
- @Named("TargetInstances:aggregatedList")
- @GET
- @Path("/targetInstances")
- @Transform(TargetInstancePages.class)
- Iterator<ListPage<TargetInstance>> targetInstances();
-
- /** @see #pageOfTargetInstances(String, ListOptions) */
- @Named("TargetInstances:aggregatedList")
- @GET
- @Path("/targetInstances")
- @Transform(TargetInstancePages.class)
- Iterator<ListPage<TargetInstance>> targetInstances(ListOptions options);
-
- static final class TargetInstancePages extends BaseToIteratorOfListPage<TargetInstance, TargetInstancePages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- TargetInstancePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<TargetInstance>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<TargetInstance>>() {
- @Override
- public ListPage<TargetInstance> apply(String pageToken) {
- return api.aggregatedList().pageOfTargetInstances(pageToken, options);
- }
- };
- }
- }
-
- /**
- * Retrieves the list of TargetPool resources available to the
- * specified project. By default the list as a maximum size of 100, if no
- * options are provided or ListOptions#getMaxResults() has not been set.
- *
- * @param pageToken
- * marks the beginning of the next list page
- * @param listOptions
- * listing options
- * @return a page of the list
- */
- @Named("TargetPool:aggregatedList")
- @GET
- @Path("/targetPools")
- ListPage<TargetPool> pageOfTargetPools(@Nullable @QueryParam("pageToken") String pageToken,
- ListOptions listOptions);
-
- /** @see #pageOfTargetPools(String, ListOptions) */
- @Named("TargetPool:aggregatedList")
- @GET
- @Path("/targetPools")
- @Transform(TargetPoolPages.class)
- Iterator<ListPage<TargetPool>> targetPools();
-
- /** @see #pageOfTargetPools(String, ListOptions) */
- @Named("TargetPool:aggregatedList")
- @GET
- @Path("/targetPools")
- @Transform(TargetPoolPages.class)
- Iterator<ListPage<TargetPool>> targetPools(ListOptions options);
-
- static final class TargetPoolPages extends BaseToIteratorOfListPage<TargetPool, TargetPoolPages> {
- private final GoogleComputeEngineApi api;
-
- @Inject
- TargetPoolPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<TargetPool>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<TargetPool>>() {
- @Override
- public ListPage<TargetPool> apply(String pageToken) {
- return api.aggregatedList().pageOfTargetPools(pageToken, options);
- }
- };
- }
- }
-}
[12/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java
deleted file mode 100644
index c33aced..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.NullOn400or404;
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Project;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface ProjectApi {
-
- /** Get the current project. */
- @Named("Projects:get")
- @GET
- @Fallback(NullOn400or404.class)
- Project get();
-
- /**
- * Sets metadata common to all instances within the current project using the data included in the request.
- * <p/>
- * NOTE: This *sets* metadata items on the project (vs *adding* items to metadata),
- * if there are existing metadata that must be kept these must be fetched first and then re-sent on update.
- * <pre><tt>
- * Metadata update = projectApi.get("myProject").getCommonInstanceMetadata().clone();
- * update.put("newItem","newItemValue");
- * projectApi.setCommonInstanceMetadata("myProject", update);
- * </tt></pre>
- *
- * @param metadata the metadata to set
- * @return an Operations resource. To check on the status of an operation, poll the Operations resource returned
- * to you, and look for the status field.
- */
- @Named("Projects:setCommonInstanceMetadata")
- @POST
- @Path("/setCommonInstanceMetadata")
- @Produces(APPLICATION_JSON)
- Operation setCommonInstanceMetadata(@BinderParam(BindToJsonPayload.class) Metadata metadata);
-
- @Named("Projects:setUsageExportBucket")
- @POST
- @Path("/setUsageExportBucket")
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation setUsageExportBucket(@PayloadParam("bucketName") String bucketName,
- @PayloadParam("reportNamePrefix") String reportNamePrefix);
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
deleted file mode 100644
index 6d9d279..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/regions")
-@Consumes(APPLICATION_JSON)
-public interface RegionApi {
-
- /** Returns a region by name or null if not found. */
- @Named("Regions:get")
- @GET
- @Path("/{region}")
- @Fallback(NullOnNotFoundOr404.class)
- Region get(@PathParam("region") String region);
-
- /**
- * Retrieves the list of region resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Regions:list")
- @GET
- ListPage<Region> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Regions:list")
- @GET
- @Transform(RegionPages.class)
- Iterator<ListPage<Region>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Regions:list")
- @GET
- @Transform(RegionPages.class)
- Iterator<ListPage<Region>> list(ListOptions options);
-
- static final class RegionPages extends BaseToIteratorOfListPage<Region, RegionPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject RegionPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Region>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Region>>() {
- @Override public ListPage<Region> apply(String pageToken) {
- return api.regions().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
deleted file mode 100644
index e6cbbb3..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.binders.RouteBinder;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Route;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.googlecomputeengine.options.RouteOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/routes")
-@Consumes(APPLICATION_JSON)
-public interface RouteApi {
-
- /** Returns a route type by name or null if not found. */
- @Named("Routes:get")
- @GET
- @Path("/{route}")
- @Fallback(NullOnNotFoundOr404.class)
- Route get(@PathParam("route") String routeName);
-
- /** Deletes a route by name and returns the operation in progress, or null if not found. */
- @Named("Routes:delete")
- @DELETE
- @Path("/{route}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("route") String routeName);
-
- /**
- * Creates a route resource in the specified project using the data included in the request.
- *
- * @param name the name of the route to be inserted.
- * @param network the network to which to add the route
- * @param routeOptions the options of the route to add
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("Routes:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(RouteBinder.class)
- Operation createInNetwork(@PayloadParam("name") String name,
- @PayloadParam("network") URI network,
- @PayloadParam("options") RouteOptions routeOptions);
-
- /**
- * Retrieves the list of route resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Routes:list")
- @GET
- ListPage<Route> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Routes:list")
- @GET
- @Transform(RoutePages.class)
- Iterator<ListPage<Route>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Routes:list")
- @GET
- @Transform(RoutePages.class)
- Iterator<ListPage<Route>> list(ListOptions options);
-
- static final class RoutePages extends BaseToIteratorOfListPage<Route, RoutePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject RoutePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Route>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Route>>() {
- @Override public ListPage<Route> apply(String pageToken) {
- return api.routes().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
deleted file mode 100644
index 13c1a35..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Snapshot;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/snapshots")
-@Consumes(APPLICATION_JSON)
-public interface SnapshotApi {
-
- /** Returns a snapshot by name or null if not found. */
- @Named("Snapshots:get")
- @GET
- @Path("/{snapshot}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Snapshot get(@PathParam("snapshot") String snapshot);
-
- /** Deletes a snapshot by name and returns the operation in progress, or null if not found. */
- @Named("Snapshots:delete")
- @DELETE
- @Path("/{snapshot}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("snapshot") String snapshot);
-
- /**
- * Retrieves the list of snapshot resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Snapshots:list")
- @GET
- ListPage<Snapshot> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Snapshots:list")
- @GET
- @Transform(SnapshotPages.class)
- Iterator<ListPage<Snapshot>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Snapshots:list")
- @GET
- @Transform(SnapshotPages.class)
- Iterator<ListPage<Snapshot>> list(ListOptions options);
-
- static final class SnapshotPages extends BaseToIteratorOfListPage<Snapshot, SnapshotPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject SnapshotPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Snapshot>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Snapshot>>() {
- @Override public ListPage<Snapshot> apply(String pageToken) {
- return api.snapshots().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApi.java
deleted file mode 100644
index 97c45d4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApi.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.TargetHttpProxy;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.googlecomputeengine.options.TargetHttpProxyOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@Consumes(MediaType.APPLICATION_JSON)
-@RequestFilters(OAuthFilter.class)
-public interface TargetHttpProxyApi {
-
- /**
- * Returns the specified target http proxy resource.
- *
- * @param targetHttpProxyName name of the targetHttpProxy resource to return.
- * @return an TargetHttpProxy resource.
- */
- @Named("TargetHttpProxys:get")
- @GET
- @Path("/global/targetHttpProxies/{targetHttpProxy}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- TargetHttpProxy get(@PathParam("targetHttpProxy") String targetHttpProxyName);
-
- /**
- * Creates a TargetHttpProxy resource in the specified project using the data included in the request.
- * @param targetHttpProxyOptions the options of the targetHttpProxy to add.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetHttpProxys:insert")
- @POST
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/global/targetHttpProxies")
- Operation create(@BinderParam(BindToJsonPayload.class) TargetHttpProxyOptions targetHttpProxyOptions);
-
- //TODO (broudy) : Should we remove this because it is redundant?
- /**
- * Creates a targetHttpProxy resource in the specified project using the given URI for the urlMap.
- *
- * @param name the name of the targetHttpProxy to be inserted.
- * @param urlMap URI of the urlMap this proxy points to.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetHttpProxys:insert")
- @POST
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/global/targetHttpProxies")
- @MapBinder(BindToJsonPayload.class)
- Operation create(@PayloadParam("name") String name, @PayloadParam("urlMap") URI urlMap);
-
- /**
- * Updates the specified targetHttpProxy resource with the data included in the request.
- *
- * @param targetHttpProxyName the name targetHttpProxy to be updated.
- * @param urlMap the new url map this target http proxy points to.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetHttpProxys:setUrlMap")
- @POST
- @Produces(MediaType.APPLICATION_JSON)
- @Path("targetHttpProxies/{targetHttpProxy}/setUrlMap")
- @MapBinder(BindToJsonPayload.class)
- Operation setUrlMap(@PathParam("targetHttpProxy") String targetHttpProxyName,
- @PayloadParam("urlMap") URI urlMap);
-
- /**
- * Deletes the specified image resource.
- *
- * @param targetHttpProxyName name of the targetHttpProxy resource to delete.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field. If the image did not exist the result is null.
- */
- @Named("TargetHttpProxys:delete")
- @DELETE
- @Path("/global/targetHttpProxies/{targetHttpProxy}")
- @Fallback(NullOnNotFoundOr404.class)
- Operation delete(@PathParam("targetHttpProxy") String targetHttpProxyName);
-
- /**
- * Retrieves the list of targetHttpProxy resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("TargetHttpProxys:list")
- @GET
- @Path("/global/targetHttpProxies")
- ListPage<TargetHttpProxy> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("TargetHttpProxys:list")
- @GET
- @Path("/global/targetHttpProxies")
- @Transform(TargetHttpProxyPages.class)
- Iterator<ListPage<TargetHttpProxy>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("TargetHttpProxys:list")
- @GET
- @Path("/global/targetHttpProxies")
- @Transform(TargetHttpProxyPages.class)
- Iterator<ListPage<TargetHttpProxy>> list(ListOptions listOptions);
-
- static final class TargetHttpProxyPages extends BaseToIteratorOfListPage<TargetHttpProxy, TargetHttpProxyPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject TargetHttpProxyPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<TargetHttpProxy>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<TargetHttpProxy>>() {
- @Override public ListPage<TargetHttpProxy> apply(String pageToken) {
- return api.targetHttpProxies().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetInstanceApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetInstanceApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetInstanceApi.java
deleted file mode 100644
index 6d2c3cc..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetInstanceApi.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.NewTargetInstance;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.TargetInstance;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/targetInstances")
-@Consumes(APPLICATION_JSON)
-public interface TargetInstanceApi {
-
- /** Returns a targetInstance by name or null if not found. */
- @Named("TargetInstances:get")
- @GET
- @Path("/{targetInstance}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- TargetInstance get(@PathParam("targetInstance") String targetInstance);
-
- /**
- * Creates a instance resource in the specified project using the data included in the request.
- *
- * @param template the instance template
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetInstances:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) NewTargetInstance targetInstance);
-
- /** Deletes a targetInstance by name and returns the operation in progress, or null if not found. */
- @Named("TargetInstances:delete")
- @DELETE
- @Path("/{targetInstance}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("targetInstance") String targetInstance);
-
- /**
- * Retrieves the list of targetInstance resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("TargetInstances:list")
- @GET
- ListPage<TargetInstance> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("TargetInstances:list")
- @GET
- @Transform(TargetInstancePages.class)
- Iterator<ListPage<TargetInstance>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("TargetInstances:list")
- @GET
- @Transform(TargetInstancePages.class)
- Iterator<ListPage<TargetInstance>> list(ListOptions options);
-
- static final class TargetInstancePages extends BaseCallerArg0ToIteratorOfListPage<TargetInstance, TargetInstancePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject TargetInstancePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<TargetInstance>> fetchNextPage(final String zoneName, final ListOptions options) {
- return new Function<String, ListPage<TargetInstance>>() {
- @Override public ListPage<TargetInstance> apply(String pageToken) {
- return api.targetInstancesInZone(zoneName).listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
deleted file mode 100644
index 6d57086..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.binders.TargetPoolChangeHealthChecksBinder;
-import org.jclouds.googlecomputeengine.binders.TargetPoolChangeInstancesBinder;
-import org.jclouds.googlecomputeengine.domain.HealthStatus;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/targetPools")
-@Consumes(APPLICATION_JSON)
-public interface TargetPoolApi {
-
- /** Returns a target pool by name or null if not found. */
- @Named("TargetPools:get")
- @GET
- @Path("/{targetPool}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- TargetPool get(@PathParam("targetPool") String targetPool);
-
- /**
- * Creates a TargetPool resource in the specified project and region using the data included in the request.
- *
- * @param name the name of the targetPool.
- * @param options options of the TargetPool to create.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) TargetPoolCreationOptions options);
-
- /** Deletes a target pool by name and returns the operation in progress, or null if not found. */
- @Named("TargetPools:delete")
- @DELETE
- @Path("/{targetPool}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- Operation delete(@PathParam("targetPool") String targetPool);
-
- /**
- * Adds instance to the targetPool.
- *
- * @param targetPool the name of the target pool.
- * @param instances the self-links of the instances to be added to targetPool.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:addInstance")
- @POST
- @Path("/{targetPool}/addInstance")
- @MapBinder(TargetPoolChangeInstancesBinder.class)
- Operation addInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances);
-
- /**
- * Removes instance URL from targetPool.
- *
- * @param targetPool the name of the target pool.
- * @param instances the self-links of the instances to be removed from the targetPool.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:removeInstance")
- @POST
- @Path("/{targetPool}/removeInstance")
- @MapBinder(TargetPoolChangeInstancesBinder.class)
- Operation removeInstance(@PathParam("targetPool") String targetPool, @PayloadParam("instances") List<URI> instances);
-
- /**
- * Adds health check URL to targetPool.
- *
- * @param targetPool the name of the target pool.
- * @param healthChecks the self-links of the health checks to be added to targetPool.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:addHealthCheck")
- @POST
- @Path("/{targetPool}/addHealthCheck")
- @MapBinder(TargetPoolChangeHealthChecksBinder.class)
- Operation addHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks);
-
-
- /**
- * Removes health check URL from targetPool.
- *
- * @param targetPool the name of the target pool.
- * @param healthChecks the self-links of the health checks to be removed from the targetPool.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:removeHealthCheck")
- @POST
- @Path("/{targetPool}/removeHealthCheck")
- @MapBinder(TargetPoolChangeHealthChecksBinder.class)
- Operation removeHealthCheck(@PathParam("targetPool") String targetPool, @PayloadParam("healthChecks") List<URI> healthChecks);
-
- /**
- * Gets the HealthStatus of an instance in a targetPool.
- *
- * @param targetPool the name of the target pool.
- * @param healthChecks the self-links of the health checks to be removed from the targetPool.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:getHealth")
- @POST
- @Path("/{targetPool}/getHealth")
- @MapBinder(BindToJsonPayload.class)
- HealthStatus getHealth(@PathParam("targetPool") String targetPool, @PayloadParam("instance") URI instance);
-
-
- /**
- * Changes backup pool configurations.
- *
- * @param targetPool the name of the target pool.
- * @param target the URL of target pool for which you want to use as backup.
- * WARNING: failoverRatio and BackupPool must either both be set or not set. This method
- * is only for updating the backup pool on a Target Pool that already has a
- * failoverRatio.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:setBackup")
- @POST
- @Path("/{targetPool}/setBackup")
- @MapBinder(BindToJsonPayload.class)
- @Nullable
- Operation setBackup(@PathParam("targetPool") String targetPool, @PayloadParam("target") URI target);
-
- /**
- * Changes backup pool configurations.
- *
- * @param targetPool the name of the target pool.
- * @param target the URL of target pool for which you want to use as backup.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("TargetPools:setBackup")
- @POST
- @Path("/{targetPool}/setBackup")
- @MapBinder(BindToJsonPayload.class)
- @Nullable
- Operation setBackup(@PathParam("targetPool") String targetPool, @QueryParam("failoverRatio") Float failoverRatio, @PayloadParam("target") URI target);
-
- /**
- * Retrieves the list of target pool resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("TargetPools:list")
- @GET
- ListPage<TargetPool> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("TargetPools:list")
- @GET
- @Transform(TargetPoolPages.class)
- Iterator<ListPage<TargetPool>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("TargetPools:list")
- @GET
- @Transform(TargetPoolPages.class)
- Iterator<ListPage<TargetPool>> list(ListOptions options);
-
- static final class TargetPoolPages extends BaseCallerArg0ToIteratorOfListPage<TargetPool, TargetPoolPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject TargetPoolPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override
- protected Function<String, ListPage<TargetPool>> fetchNextPage(final String regionName,
- final ListOptions options) {
- return new Function<String, ListPage<TargetPool>>() {
- @Override public ListPage<TargetPool> apply(String pageToken) {
- return api.targetPoolsInRegion(regionName).listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/UrlMapApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/UrlMapApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/UrlMapApi.java
deleted file mode 100644
index d77c542..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/UrlMapApi.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.UrlMap;
-import org.jclouds.googlecomputeengine.domain.UrlMapValidateResult;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.googlecomputeengine.options.UrlMapOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PATCH;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface UrlMapApi {
-
- /** Returns the specified urlMap resource by name or null if not found. */
- @Named("UrlMaps:get")
- @GET
- @Path("/{urlMap}")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- UrlMap get(@PathParam("urlMap") String urlMapName);
-
- /**
- * Creates a urlMap resource in the specified project using the data included in the request.
- * @param urlMapOptions the options of the urlMap to add.
- *
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("UrlMaps:insert")
- @POST
- @Produces(APPLICATION_JSON)
- Operation create(@BinderParam(BindToJsonPayload.class) UrlMapOptions urlMapOptions);
-
- /**
- * Creates a urlMap resource in the specified project using the data included in the request.
- *
- * @param name the name of the urlMap to be inserted.
- * @param defaultService the default backend service of the urlMap to add.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("UrlMaps:insert")
- @POST
- @Produces(APPLICATION_JSON)
- @MapBinder(BindToJsonPayload.class)
- Operation create(@PayloadParam("name") String name,
- @PayloadParam("defaultService") URI defaultService);
-
- /**
- * Updates the specified urlMap resource with the data included in the request.
- *
- * @param urlMapName the name urlMap to be updated.
- * @param urlMapOptions the new urlMap options.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("UrlMaps:update")
- @PUT
- @Produces(APPLICATION_JSON)
- @Path("/{urlMap}")
- Operation update(@PathParam("urlMap") String urlMapName,
- @BinderParam(BindToJsonPayload.class) UrlMapOptions urlMapOptions);
-
- /**
- * Updates the specified urlMap resource, with patch semantics, with the data included in the request.
- * Note:{@link UrlMapOptions.Builder#buildForPatch()} may be helpful.
- *
- * @param urlMapName the name urlMap to be updated.
- * @param urlMapOptions the new urlMap options.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field.
- */
- @Named("UrlMaps:patch")
- @PATCH
- @Produces(APPLICATION_JSON)
- @Path("/{urlMap}")
- Operation patch(@PathParam("urlMap") String urlMapName,
- @BinderParam(BindToJsonPayload.class) UrlMapOptions urlMapOptions);
-
- /**
- * Deletes the specified urlMap resource.
- *
- * @param urlMapName name of the urlMap resource to delete.
- * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to
- * you, and look for the status field. If the image did not exist the result is null.
- */
- @Named("UrlMaps:delete")
- @DELETE
- @Path("/{urlMap}")
- @Fallback(NullOnNotFoundOr404.class)
- Operation delete(@PathParam("urlMap") String urlMapName);
-
- /**
- * Runs the tests specified for the give urlMap resource.
- *
- * @param urlMapName name of the urlMap to run tests on.
- * @param options options that represent the url map to be tested.
- * @return the result of the tests for the given urlMap resource.
- */
- @Named("UrlMaps:validate")
- @POST
- @Path("/{urlMap}/validate")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- @MapBinder(BindToJsonPayload.class)
- UrlMapValidateResult validate(@PathParam("urlMap") String urlMapName,
- @PayloadParam("resource") UrlMapOptions options);
-
- /**
- * Runs the tests specified for the give urlMap resource.
- *
- * @param urlMapName name of the urlMap to run tests on.
- * @param urlMap the url map to be tested.
- * @return the result of the tests for the given urlMap resource.
- */
- @Named("UrlMaps:validate")
- @POST
- @Path("/{urlMap}/validate")
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- @MapBinder(BindToJsonPayload.class)
- UrlMapValidateResult validate(@PathParam("urlMap") String urlMapName,
- @PayloadParam("resource") UrlMap urlMap);
-
- /**
- * Retrieves the list of urlMap resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("UrlMaps:list")
- @GET
- ListPage<UrlMap> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, String, ListOptions) */
- @Named("UrlMaps:list")
- @GET
- @Transform(UrlMapPages.class)
- Iterator<ListPage<UrlMap>> list();
-
- /** @see #listPage(String, String, ListOptions) */
- @Named("UrlMaps:list")
- @GET
- @Transform(UrlMapPages.class)
- Iterator<ListPage<UrlMap>> list(ListOptions options);
-
- static final class UrlMapPages extends BaseToIteratorOfListPage<UrlMap, UrlMapPages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject UrlMapPages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<UrlMap>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<UrlMap>>() {
- @Override public ListPage<UrlMap> apply(String pageToken) {
- return api.urlMaps().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
deleted file mode 100644
index 0a5ec67..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.annotations.Transform;
-
-import com.google.common.base.Function;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Path("/zones")
-@Consumes(APPLICATION_JSON)
-public interface ZoneApi {
-
- /** Returns a zone by name or null if not found. */
- @Named("Zones:get")
- @GET
- @Path("/{zone}")
- @Fallback(NullOnNotFoundOr404.class)
- Zone get(@PathParam("zone") String zone);
-
- /**
- * Retrieves the list of zone resources available to the specified project.
- * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
- * been set.
- *
- * @param pageToken marks the beginning of the next list page
- * @param listOptions listing options
- * @return a page of the list
- */
- @Named("Zones:list")
- @GET
- ListPage<Zone> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
-
- /** @see #listPage(String, ListOptions) */
- @Named("Zones:list")
- @GET
- @Transform(ZonePages.class)
- Iterator<ListPage<Zone>> list();
-
- /** @see #listPage(String, ListOptions) */
- @Named("Zones:list")
- @GET
- @Transform(ZonePages.class)
- Iterator<ListPage<Zone>> list(ListOptions options);
-
- static final class ZonePages extends BaseToIteratorOfListPage<Zone, ZonePages> {
-
- private final GoogleComputeEngineApi api;
-
- @Inject ZonePages(GoogleComputeEngineApi api) {
- this.api = api;
- }
-
- @Override protected Function<String, ListPage<Zone>> fetchNextPage(final ListOptions options) {
- return new Function<String, ListPage<Zone>>() {
- @Override public ListPage<Zone> apply(String pageToken) {
- return api.zones().listPage(pageToken, options);
- }
- };
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandler.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandler.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandler.java
deleted file mode 100644
index 6f7bb73..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.handlers;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- */
-public class GoogleComputeEngineErrorHandler implements HttpErrorHandler {
- public void handleError(HttpCommand command, HttpResponse response) {
- // it is important to always read fully and close streams
- byte[] data = closeClientButKeepContentStream(response);
- String message = data != null ? new String(data) : null;
-
- Exception exception = message != null ? new HttpResponseException(command, response, message)
- : new HttpResponseException(command, response);
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 400:
- break;
- case 401:
- case 403:
- exception = new AuthorizationException(message, exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- exception = new ResourceNotFoundException(message, exception);
- }
- break;
- case 409:
- exception = new IllegalStateException(message, exception);
- break;
- }
- command.setException(exception);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseArg0ToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseArg0ToIteratorOfListPage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseArg0ToIteratorOfListPage.java
deleted file mode 100644
index bb39a13..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseArg0ToIteratorOfListPage.java
+++ /dev/null
@@ -1,23 +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.internal;
-
-import org.jclouds.googlecomputeengine.options.ListOptions;
-
-public abstract class BaseArg0ToIteratorOfListPage<T, I extends BaseArg0ToIteratorOfListPage<T, I>>
- extends org.jclouds.googlecloud.internal.BaseArg0ToIteratorOfListPage<T, ListOptions, I> {
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseCallerArg0ToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseCallerArg0ToIteratorOfListPage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseCallerArg0ToIteratorOfListPage.java
deleted file mode 100644
index 97ca5a4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseCallerArg0ToIteratorOfListPage.java
+++ /dev/null
@@ -1,23 +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.internal;
-
-import org.jclouds.googlecomputeengine.options.ListOptions;
-
-public abstract class BaseCallerArg0ToIteratorOfListPage<T, I extends BaseCallerArg0ToIteratorOfListPage<T, I>>
- extends org.jclouds.googlecloud.internal.BaseCallerArg0ToIteratorOfListPage<T, ListOptions, I> {
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseToIteratorOfListPage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseToIteratorOfListPage.java
deleted file mode 100644
index 5f53618..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/internal/BaseToIteratorOfListPage.java
+++ /dev/null
@@ -1,23 +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.internal;
-
-import org.jclouds.googlecomputeengine.options.ListOptions;
-
-public abstract class BaseToIteratorOfListPage<T, I extends BaseToIteratorOfListPage<T, I>>
- extends org.jclouds.googlecloud.internal.BaseToIteratorOfListPage<T, ListOptions, I> {
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/AddressCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/AddressCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/AddressCreationOptions.java
deleted file mode 100644
index 413a61d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/AddressCreationOptions.java
+++ /dev/null
@@ -1,62 +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.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class AddressCreationOptions {
-
- public abstract String name();
- @Nullable public abstract String address();
- @Nullable public abstract String description();
-
- @SerializedNames({"name", "address", "description"})
- static AddressCreationOptions create(String name, String address, String description){
- return new AutoValue_AddressCreationOptions(name, address, description);
- }
-
- public static class Builder {
- private String name;
- private String address;
- private String description;
-
- public Builder(String name) {
- this.name = name;
- }
-
- public Builder address(String address) {
- this.address = address;
- return this;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public AddressCreationOptions build() {
- checkNotNull(name, "AddressCreationOptions name cannot be null");
- return create(name, address, description);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/BackendServiceOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/BackendServiceOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/BackendServiceOptions.java
deleted file mode 100644
index 0257882..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/BackendServiceOptions.java
+++ /dev/null
@@ -1,155 +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.options;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.BackendService.Backend;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class BackendServiceOptions {
-
- @Nullable public abstract String name();
- @Nullable public abstract String description();
- @Nullable public abstract List<URI> healthChecks();
- @Nullable public abstract List<Backend> backends();
- @Nullable public abstract Integer timeoutSec();
- @Nullable public abstract Integer port();
- @Nullable public abstract String protocol();
- @Nullable public abstract String fingerprint();
- @Nullable public abstract String portName();
-
- @SerializedNames({"name", "description", "healthChecks", "backends", "timeoutSec",
- "port", "protocol", "fingerprint", "portName"})
- static BackendServiceOptions create(String name, String description, List<URI> healthChecks,
- List<Backend> backends, Integer timeoutSec, Integer port, String protocol, String fingerprint, String portName){
- return new AutoValue_BackendServiceOptions(name, description, healthChecks,
- backends, timeoutSec, port, protocol, fingerprint, portName);
- }
-
- BackendServiceOptions(){
- }
-
- public static class Builder {
-
- private String name;
- private String description;
- private List<URI> healthChecks;
- private List<Backend> backends;
- private Integer timeoutSec;
- private Integer port;
- private String protocol;
- private String fingerprint;
- private String portName;
-
- /**
- * @param name, provided by the client.
- * @param healthChecks The list of {@link HttpHealthCheck#selfLink Links} to the HttpHealthCheck
- * resource for health checking this BackendService.
- * Currently at most one health check can be specified, and a health check is required.
- */
- public Builder(String name, List<URI> healthChecks){
- this.name = name;
- this.healthChecks = healthChecks;
- }
-
- /**
- * Empty builder for use when patching or updating and existing BackendService
- * Otherwise use the other {@link #Builder(String, List) builder}
- */
- public Builder(){
- }
-
- /**
- * An optional textual description of the BackendService.
- */
- public Builder description(String description){
- this.description = description;
- return this;
- }
-
- /**
- * HealthChecks - The list of {@link HttpHealthCheck#selfLink Links} to the HttpHealthCheck
- * resource for health checking this BackendService.
- * Currently at most one health check can be specified, and a health check is required.
- */
- public Builder healthChecks(List<URI> healthChecks){
- this.healthChecks = healthChecks;
- return this;
- }
-
- /**
- * The list of backends that serve this BackendService.
- */
- public Builder backends(List<Backend> backends){
- this.backends = backends;
- return this;
- }
-
- /**
- * How many seconds to wait for the backend before considering it a failed request.
- * Default is 30 seconds.
- */
- public Builder timeoutSec(Integer timeoutSec) {
- this.timeoutSec = timeoutSec;
- return this;
- }
-
- /**
- * The TCP port to connect on the backend.
- * The default value is 80.
- */
- public Builder port(Integer port) {
- this.port = port;
- return this;
- }
-
- /**
- * The protocol for incoming requests.
- */
- public Builder protocol(String protocol) {
- this.protocol = protocol;
- return this;
- }
-
- /**
- * Fingerprint of this resource. A hash of the contents stored in this object.
- * This field is used in optimistic locking. This field will be ignored when
- * inserting a BackendService. An up-to-date fingerprint must be provided in
- * order to update the BackendService.
- */
- public Builder fingerprint(String fingerprint) {
- this.fingerprint = fingerprint;
- return this;
- }
-
- public Builder portName(String portName) {
- this.portName = portName;
- return this;
- }
-
- public BackendServiceOptions build(){
- return create(name, description, healthChecks,
- backends, timeoutSec, port, protocol, fingerprint, portName);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DeprecateOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DeprecateOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DeprecateOptions.java
deleted file mode 100644
index 9f4a5ef..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DeprecateOptions.java
+++ /dev/null
@@ -1,113 +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.options;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.googlecomputeengine.domain.Deprecated.State;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/**
- * Options to set the deprecation status of a resource. Currently only for images.
- *
- * @see <a href="https://developers.google.com/compute/docs/reference/latest/images/deprecate" />
- */
-@AutoValue
-public abstract class DeprecateOptions {
-
- @Nullable public abstract State state();
- @Nullable public abstract URI replacement();
- @Nullable public abstract Date deprecated();
- @Nullable public abstract Date obsolete();
- @Nullable public abstract Date deleted();
-
- @SerializedNames({"state", "replacement", "deprecated", "obsolete", "deleted"})
- static DeprecateOptions create(State state, URI replacement, Date deprecated,
- Date obsolete, Date deleted){
- return new AutoValue_DeprecateOptions(state, replacement, deprecated, obsolete, deleted);
- }
-
- DeprecateOptions(){
- }
-
- public static class Builder {
- private State state;
- private URI replacement;
- private Date deprecated;
- private Date obsolete;
- private Date deleted;
-
- /**
- * The new deprecation state.
- *
- * @return the new deprecation state.
- */
- public Builder state(State state) {
- this.state = state;
- return this;
- }
-
- /**
- * Optional URL for replacement of deprecated resource.
- *
- * @return the URL
- */
- public Builder replacement(URI replacement) {
- this.replacement = replacement;
- return this;
- }
-
- /**
- * Optional RFC3339 timestamp for when the deprecation state was changed to DEPRECATED.
- *
- * @return the timestamp
- */
- public Builder deprecated(Date deprecated) {
- this.deprecated = deprecated;
- return this;
- }
-
- /**
- * Optional RFC3339 timestamp for when the deprecation state was changed to OBSOLETE.
- *
- * @return the timestamp
- */
- public Builder obsolete(Date obsolete) {
- this.obsolete = obsolete;
- return this;
- }
-
- /**
- * Optional RFC3339 timestamp for when the deprecation state was changed to DELETED.
- *
- * @return the timestamp
- */
- public Builder deleted(Date deleted) {
- this.deleted = deleted;
- return this;
- }
-
- public DeprecateOptions build(){
- return create(state, replacement, deprecated,
- obsolete, deleted);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DiskCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DiskCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DiskCreationOptions.java
deleted file mode 100644
index 5acb015..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/DiskCreationOptions.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.options;
-
-import java.net.URI;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class DiskCreationOptions {
-
- @Nullable public abstract URI type();
- @Nullable public abstract Integer sizeGb();
- @Nullable public abstract URI sourceSnapshot();
- @Nullable public abstract String description();
-
- @SerializedNames({"type", "sizeGb", "sourceSnapshot", "description"})
- static DiskCreationOptions create(URI type, Integer sizeGb, URI sourceSnapshot,
- String description){
- return new AutoValue_DiskCreationOptions(type, sizeGb, sourceSnapshot, description);
- }
-
- DiskCreationOptions(){
- }
-
- public static class Builder {
-
- private URI type;
- private Integer sizeGb;
- private URI sourceSnapshot;
- private String description;
-
- /**
- * The disk type, fully qualified URL for the disk type.
- *
- * @return the disk type
- */
- public Builder type(URI type) {
- this.type = type;
- return this;
- }
-
- /**
- * Size of the persistent disk, specified in GB.
- * You can also specify this when creating a persistent disk
- * using the sourceImage or sourceSnapshot parameter.
- */
- public Builder sizeGb(Integer sizeGb) {
- this.sizeGb = sizeGb;
- return this;
- }
-
- /**
- * The source snapshot
- *
- * @return sourceSnapshot, fully qualified URL for the snapshot to be copied.
- */
- public Builder sourceSnapshot(URI sourceSnapshot) {
- this.sourceSnapshot = sourceSnapshot;
- return this;
- }
-
- /**
- * The description
- *
- * @return description, An optional textual description of the resource.
- */
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public DiskCreationOptions build(){
- return create(type, sizeGb, sourceSnapshot, description);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java
deleted file mode 100644
index eb4d4ce..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/FirewallOptions.java
+++ /dev/null
@@ -1,182 +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.options;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.Firewall;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * Options to insert a firewall.
- *
- * @see Firewall
- */
-public class FirewallOptions {
-
- private String name;
- private URI network;
- private String description;
- private ImmutableList.Builder<String> sourceRanges = ImmutableList.builder();
- private ImmutableList.Builder<String> sourceTags = ImmutableList.builder();
- private ImmutableList.Builder<String> targetTags = ImmutableList.builder();
- private ImmutableList.Builder<Firewall.Rule> allowed = ImmutableList.builder();
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#allowed()
- */
- public List<Firewall.Rule> getAllowed() {
- return allowed.build();
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#allowed()
- */
- public FirewallOptions addAllowedRule(Firewall.Rule allowedRule) {
- this.allowed.add(allowedRule);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#allowed()
- */
- public FirewallOptions allowedRules(List<Firewall.Rule> allowedRules) {
- this.allowed = ImmutableList.builder();
- this.allowed.addAll(allowedRules);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#name()
- */
- public FirewallOptions name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#name()
- */
- public String name() {
- return name;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#description()
- */
- public FirewallOptions description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#description()
- */
- public String description() {
- return description;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#network()
- */
- public FirewallOptions network(URI network) {
- this.network = network;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#network()
- */
- public URI network() {
- return network;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#sourceRanges()
- */
- public List<String> sourceRanges() {
- return sourceRanges.build();
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#sourceRanges()
- */
- public FirewallOptions addSourceRange(String sourceRange) {
- this.sourceRanges.add(sourceRange);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#sourceRanges()
- */
- public FirewallOptions sourceRanges(Iterable<String> sourceRanges) {
- this.sourceRanges = ImmutableList.builder();
- this.sourceRanges.addAll(sourceRanges);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#sourceTags()
- */
- public List<String> sourceTags() {
- return sourceTags.build();
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#sourceTags()
- */
- public FirewallOptions addSourceTag(String sourceTag) {
- this.sourceTags.add(sourceTag);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#sourceTags()
- */
- public FirewallOptions sourceTags(Iterable<String> sourceTags) {
- this.sourceTags = ImmutableList.builder();
- this.sourceTags.addAll(sourceTags);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#targetTags()
- */
- public List<String> targetTags() {
- return targetTags.build();
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#targetTags()
- */
- public FirewallOptions addTargetTag(String targetTag) {
- this.targetTags.add(targetTag);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Firewall#targetTags()
- */
- public FirewallOptions targetTags(List<String> targetTags) {
- this.targetTags = ImmutableList.builder();
- this.targetTags.addAll(targetTags);
- return this;
- }
-}
-
[08/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiMockTest.java
deleted file mode 100644
index 5cbc78f..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiMockTest.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-import java.util.Arrays;
-
-import org.jclouds.googlecomputeengine.domain.AttachDisk;
-import org.jclouds.googlecomputeengine.domain.AttachDisk.DiskInterface;
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig;
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling;
-import org.jclouds.googlecomputeengine.domain.Instance.ServiceAccount;
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.NewInstance;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling.OnHostMaintenance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseInstanceListTest;
-import org.jclouds.googlecomputeengine.parse.ParseInstanceSerialOutputTest;
-import org.jclouds.googlecomputeengine.parse.ParseInstanceTest;
-import org.jclouds.googlecomputeengine.parse.ParseZoneOperationTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "InstanceApiMockTest", singleThreaded = true)
-public class InstanceApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/instance_get.json"));
-
- assertEquals(instanceApi().get("test-instance"), new ParseInstanceTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances/test-instance");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(instanceApi().get("test-1"));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances/test-1");
- }
-
- public void getInstanceSerialPortOutput() throws Exception {
- server.enqueue(jsonResponse("/instance_serial_port.json"));
-
- assertEquals(instanceApi().getSerialPortOutput("test-1"),
- new ParseInstanceSerialOutputTest().expected(url("/projects")));
-
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances/test-1/serialPort");
- }
-
- public void insert_noOptions() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- NewInstance newInstance = NewInstance.create(
- "test-1", // name
- URI.create(url("/projects/party/zones/us-central1-a/machineTypes/n1-standard-1")), // machineType
- URI.create(url("/projects/party/global/networks/default")), // network
- URI.create(url("/projects/party/global/images/centos-6-2-v20120326")) // sourceImage
- );
-
- assertEquals(instanceApi().create(newInstance), new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances",
- stringFromResource("/instance_insert_simple.json"));
- }
-
- public void insert_allOptions() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- NewInstance newInstance = NewInstance.create(
- "test-1", // name
- URI.create(url("/projects/party/zones/us-central1-a/machineTypes/n1-standard-1")), // machineType
- URI.create(url("/projects/party/global/networks/default")), // network
- Arrays.asList(AttachDisk.existingBootDisk(URI.create(url("/projects/party/zones/us-central1-a/disks/test")))),
- "desc", // description
- null // tags
- );
-
- newInstance.metadata().put("aKey", "aValue");
- assertEquals(instanceApi().create(newInstance), new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances",
- stringFromResource("/instance_insert.json"));
- }
-
- public void addAccessConfig() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- AccessConfig config = AccessConfig.create("test-access", Type.ONE_TO_ONE_NAT, "1.1.1.1");
- assertEquals(instanceApi().addAccessConfigToNic("test-instance", config, "test-network"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-instance/"
- + "addAccessConfig?networkInterface=test-network",
- "{" +
- " \"type\": \"ONE_TO_ONE_NAT\"," +
- " \"name\": \"test-access\"," +
- " \"natIP\": \"1.1.1.1\"" +
- "}");
- }
-
- public void deleteAccessConfig() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().deleteAccessConfigFromNic("test-instance", "test-access", "test-network"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-instance/"
- + "deleteAccessConfig?accessConfig=test-access&networkInterface=test-network");
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().delete("test-1"),
- new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/zones/us-central1-a/instances/test-1");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(instanceApi().delete("test-1"));
- assertSent(server, "DELETE", "/projects/party/zones/us-central1-a/instances/test-1");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/instance_list.json"));
-
- assertEquals(instanceApi().list().next(), new ParseInstanceListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(instanceApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances");
- }
-
- public void setMetadata() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().setMetadata("test-1", Metadata.create("efgh").put("foo", "bar")),
- new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/setMetadata",
- stringFromResource("/instance_set_metadata.json"));
- }
-
- public void setTags() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().setTags("test-1", ImmutableList.of("foo", "bar"), "efgh"),
- new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/setTags",
- stringFromResource("/instance_set_tags.json"));
- }
-
- public void reset() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().reset("test-1"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/reset");
- }
-
- public void attachDisk() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().attachDisk("test-1",
- AttachDisk.create(AttachDisk.Type.PERSISTENT, // type
- AttachDisk.Mode.READ_WRITE, // mode
- URI.create(url("/projects/party/zones/us-central1-a/disks/test")), // source
- "test", // deviceName
- true, // boot
- AttachDisk.InitializeParams.create(
- "test", // diskName
- Long.parseLong("100", 10), // diskSizeGb
- URI.create(url("/projects/party/global/images/test")), // sourceImage
- URI.create(url("/projects/party/zones/us-central1-a/diskTypes/pd-standard")) // diskType
- ), // initializeParams
- true, // autoDelete
- ImmutableList.of(url("/projects/suse-cloud/global/licenses/sles-12")), // licenses
- DiskInterface.NVME // interface
- )),
- new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/attachDisk",
- stringFromResource("/instance_attach_disk.json"));
- }
-
- public void detatchDisk() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().detachDisk("test-1", "test-disk-1"),
- new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/detachDisk?deviceName=test-disk-1");
- }
-
- public void setDiskAutoDelete() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().setDiskAutoDelete("test-1", "test-disk-1", true),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/setDiskAutoDelete"
- + "?deviceName=test-disk-1&autoDelete=true");
- }
-
- public void setScheduling() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().setScheduling("test-1", OnHostMaintenance.TERMINATE, true),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/setScheduling",
- "{\"onHostMaintenance\": \"TERMINATE\",\"automaticRestart\": true}");
- }
-
- public void start_test() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().start("test-1"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/start");
- }
-
- public void stop_test() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(instanceApi().stop("test-1"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances/test-1/stop");
- }
-
- public void builderTest() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- NewInstance newInstance = new NewInstance.Builder("test-1", // name
- URI.create(url("/projects/party/zones/us-central1-a/machineTypes/n1-standard-1")), // machineType
- URI.create(url("/projects/party/global/networks/default")), // network
- URI.create(url("/projects/party/global/images/centos-6-2-v20120326"))).build(); // sourceImage)
-
- assertEquals(instanceApi().create(newInstance), new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances",
- stringFromResource("/instance_insert_simple.json"));
- }
-
- public void insert_builder_allOptions() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- NewInstance newInstance = new NewInstance.Builder(
- "test-1", // name
- URI.create(url("/projects/party/zones/us-central1-a/machineTypes/n1-standard-1")), // machineType
- URI.create(url("/projects/party/global/networks/default")), // network
- Arrays.asList(AttachDisk.existingBootDisk(URI.create(url("/projects/party/zones/us-central1-a/disks/test")))))
- .canIpForward(true)
- .description("desc")
- .tags(null)
- .metadata(Metadata.create().put("aKey", "aValue"))
- .serviceAccounts(ImmutableList.of(ServiceAccount.create("default",
- ImmutableList.of("https://www.googleapis.com/auth/compute"))))
- .scheduling(Scheduling.create(OnHostMaintenance.MIGRATE, true))
- .build();
-
- assertEquals(instanceApi().create(newInstance), new ParseZoneOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances",
- stringFromResource("/instance_insert_full.json"));
- }
-
- InstanceApi instanceApi(){
- return api().instancesInZone("us-central1-a");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiLiveTest.java
deleted file mode 100644
index 247bb4f..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiLiveTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.domain.License;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class LicenseApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String PROJECT = "suse-cloud";
- public static final String LICENSE = "sles-12";
-
-
- private LicenseApi api() {
- return api.licensesInProject(PROJECT);
- }
-
- @Test(groups = "live")
- public void testGetLicense() {
- License license = api().get(LICENSE);
- assertNotNull(license);
- assertEquals(license.name(), LICENSE);
- URI selfLink = URI.create("https://www.googleapis.com/compute/v1/projects/" +
- PROJECT + "/global/licenses/" + LICENSE);
- assertEquals(license.selfLink(), selfLink);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiMockTest.java
deleted file mode 100644
index cc88192..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/LicenseApiMockTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseLicenseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "LicenseApiMockTest", singleThreaded = true)
-public class LicenseApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/license_get.json"));
-
- assertEquals(licenseApi().get("sles-12"), new ParseLicenseTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/suse-cloud/global/licenses/sles-12");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(licenseApi().get("sles-12"));
- assertSent(server, "GET", "/projects/suse-cloud/global/licenses/sles-12");
- }
-
- public LicenseApi licenseApi(){
- return api().licensesInProject("suse-cloud");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiLiveTest.java
deleted file mode 100644
index e286971..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiLiveTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class MachineTypeApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private MachineType machineType;
-
- private MachineTypeApi api() {
- return api.machineTypesInZone(DEFAULT_ZONE_NAME);
- }
-
- @Test(groups = "live")
- public void testListMachineType() {
- Iterator<ListPage<MachineType>> pageIterator = api().list(maxResults(1));
- assertTrue(pageIterator.hasNext());
-
- List<MachineType> machineTypeAsList = pageIterator.next();
-
- assertEquals(machineTypeAsList.size(), 1);
-
- this.machineType = machineTypeAsList.get(0);
- }
-
- @Test(groups = "live", dependsOnMethods = "testListMachineType")
- public void testGetMachineType() {
- MachineType machineType = api().get(this.machineType.name());
- assertNotNull(machineType);
- assertMachineTypeEquals(machineType, this.machineType);
- }
-
- private void assertMachineTypeEquals(MachineType result, MachineType expected) {
- assertEquals(result.name(), expected.name());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiMockTest.java
deleted file mode 100644
index 058cf57..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiMockTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseMachineTypeListTest;
-import org.jclouds.googlecomputeengine.parse.ParseMachineTypeTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "MachineTypeApiMockTest", singleThreaded = true)
-public class MachineTypeApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception{
- server.enqueue(jsonResponse("/machinetype.json"));
-
- assertEquals(machineTypeApi().get("n1-standard-1"),
- new ParseMachineTypeTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/machineTypes/n1-standard-1");
- }
-
- public void get_4xx() throws Exception{
- server.enqueue(response404());
-
- assertNull(machineTypeApi().get("n1-standard-1"));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/machineTypes/n1-standard-1");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/machinetype_list.json"));
-
- assertEquals(machineTypeApi().list().next(), new ParseMachineTypeListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/machineTypes");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(machineTypeApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/machineTypes");
- }
-
- MachineTypeApi machineTypeApi() {
- return api().machineTypesInZone("us-central1-a");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java
deleted file mode 100644
index 5fac64c..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "NetworkApiLiveTest")
-public class NetworkApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String NETWORK_NAME = "network-api-live-test-network";
- private static final String IPV4_RANGE = "10.0.0.0/8";
-
- private NetworkApi api() {
- return api.networks();
- }
-
- @Test(groups = "live")
- public void testInsertNetwork() {
- assertOperationDoneSuccessfully(api().createInIPv4Range(NETWORK_NAME, IPV4_RANGE));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertNetwork")
- public void testGetNetwork() {
- Network network = api().get(NETWORK_NAME);
- assertNotNull(network);
- assertNetworkEquals(network);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetNetwork")
- public void testListNetwork() {
- Iterator<ListPage<Network>> networks = api().list(filter("name eq " + NETWORK_NAME));
-
- List<Network> networksAsList = networks.next();
-
- assertEquals(networksAsList.size(), 1);
-
- assertNetworkEquals(networksAsList.get(0));
- }
-
- @Test(groups = "live", dependsOnMethods = "testListNetwork")
- public void testDeleteNetwork() {
- assertOperationDoneSuccessfully(api().delete(NETWORK_NAME));
- }
-
- private void assertNetworkEquals(Network result) {
- assertEquals(result.name(), NETWORK_NAME);
- assertEquals(result.rangeIPv4(), IPV4_RANGE);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiMockTest.java
deleted file mode 100644
index 240ae07..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiMockTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseNetworkListTest;
-import org.jclouds.googlecomputeengine.parse.ParseNetworkTest;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "NetworkApiMockTest", singleThreaded = true)
-public class NetworkApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/network_get.json"));
-
- assertEquals(networkApi().get("jclouds-test"),
- new ParseNetworkTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/networks/jclouds-test");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(networkApi().get("jclouds-test"));
- assertSent(server, "GET", "/projects/party/global/networks/jclouds-test");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(networkApi().createInIPv4Range("test-network", "10.0.0.0/8"), new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/networks",
- stringFromResource("/network_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(networkApi().delete("jclouds-test"),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/networks/jclouds-test");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(networkApi().delete("jclouds-test"));
- assertSent(server, "DELETE", "/projects/party/global/networks/jclouds-test");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/network_list.json"));
-
- assertEquals(networkApi().list().next(), new ParseNetworkListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/networks");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(networkApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/networks");
- }
-
- NetworkApi networkApi(){
- return api().networks();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiLiveTest.java
deleted file mode 100644
index 1ba2aee..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiLiveTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.SkipException;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "GlobalOperationApiLiveTest")
-public class OperationApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private Operation operation;
-
- private OperationApi api() {
- return api.operations();
- }
-
- public void listWithOptions() {
- Iterator<ListPage<Operation>> operations = api().list(maxResults(1));
-
- // make sure that in spite of having only one result per page we get at least two results
- int count = 0;
- for (; count < 2 && operations.hasNext(); ) {
- ListPage<Operation> result = operations.next();
- if (!result.isEmpty()) {
- operation = result.get(0);
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough global operations");
- }
- assertEquals(count, 2);
- }
-
- @Test(groups = "live", dependsOnMethods = "listWithOptions")
- public void testGetOperation() {
- Operation result = api().get(operation.selfLink());
- assertNotNull(result);
- assertEquals(result.name(), operation.name()); // Checking state besides name can lead to flaky test.
- }
-
- public void listInRegionWithOptions() {
- Iterator<ListPage<Operation>> operations = api().listInRegion(DEFAULT_REGION_NAME, maxResults(1));
-
- // make sure that in spite of having only one result per page we get at least two results
- int count = 0;
- for (; count < 2 && operations.hasNext(); ) {
- ListPage<Operation> result = operations.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough region operations");
- }
- assertEquals(count, 2);
- }
-
- public void listInZoneWithOptions() {
- Iterator<ListPage<Operation>> operations = api().listInZone(DEFAULT_ZONE_NAME, maxResults(1));
-
- // make sure that in spite of having only one result per page we get at least two results
- int count = 0;
- for (; count < 2 && operations.hasNext(); ) {
- ListPage<Operation> result = operations.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough zone operations");
- }
- assertEquals(count, 2);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiMockTest.java
deleted file mode 100644
index 3c4caa8..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiMockTest.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationListTest;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseRegionOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseZoneOperationTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.squareup.okhttp.mockwebserver.MockResponse;
-
-@Test(groups = "unit", testName = "OperationApiMockTest", singleThreaded = true)
-public class OperationApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- assertEquals(operationApi().get(URI.create(url("/projects/party/global/operations/operation-1354084865060"))),
- new ParseGlobalOperationTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/operations/operation-1354084865060");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(operationApi().get(URI.create(url("/projects/party/global/operations/operation-1354084865060"))));
- assertSent(server, "GET", "/projects/party/global/operations/operation-1354084865060");
- }
-
- public void delete() throws Exception {
- server.enqueue(new MockResponse().setBody(""));
-
- operationApi().delete(URI.create(url("/projects/party/global/operations/operation-1352178598164-4cdcc9d031510-4aa46279")));
- assertSent(server, "DELETE", "/projects/party/global/operations/operation-1352178598164-4cdcc9d031510-4aa46279");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- operationApi().delete(URI.create(url("/projects/party/global/operations/operation-1352178598164-4cdcc9d031510-4aa46279")));
- assertSent(server, "DELETE", "/projects/party/global/operations/operation-1352178598164-4cdcc9d031510-4aa46279");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/global_operation_list.json"));
-
- assertEquals(operationApi().list().next(), new ParseGlobalOperationListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/operations");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(operationApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/operations");
- }
-
- public void listPage_options() throws Exception {
- server.enqueue(jsonResponse("/global_operation_list.json"));
-
- assertEquals(operationApi().listPage("CglPUEVSQVRJT04SOzU5MDQyMTQ4Nzg1Mi5vcGVyYXRpb24tMTM1Mj" +
- "I0NDI1ODAzMC00Y2RkYmU2YTJkNmIwLWVkMzIyMzQz",
- filter("status eq done").maxResults(3)), new ParseGlobalOperationListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/operations?pageToken=CglPUEVSQVRJT04SOzU5MDQyMTQ4Nzg1Mi5vcG" +
- "VyYXRpb24tMTM1MjI0NDI1ODAzMC00Y2RkYmU2YTJkNmIwLWVkMzIyMzQz&" +
- "filter=status%20eq%20done&maxResults=3");
- }
-
- private ListPage<Operation> regionList() {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseRegionOperationTest().expected(url("/projects"))), // items
- null // nextPageToken
- );
- }
-
- public void listInRegion() throws Exception {
- server.enqueue(jsonResponse("/region_operation_list.json"));
-
- assertEquals(operationApi().listInRegion("us-central1").next(), regionList());
- assertSent(server, "GET", "/projects/party/regions/us-central1/operations");
- }
-
- public void listInRegion_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(operationApi().listInRegion("us-central1").hasNext());
- assertSent(server, "GET", "/projects/party/regions/us-central1/operations");
- }
-
- public void listPageInRegion() throws Exception {
- server.enqueue(jsonResponse("/region_operation_list.json"));
-
- assertEquals(operationApi().listPageInRegion("us-central1", "CglPUEVSQVRJT04SOzU5MDQyMTQ4Nzg1Mi5vcGVyYXRpb24tMTM1MjI0NDI1ODAzMC00Y2RkYmU2YTJkNmIwLWVkMzIyMzQz",
- filter("status eq done").maxResults(3)).toString(), regionList().toString());
- assertSent(server, "GET", "/projects/party/regions/us-central1/operations?pageToken=CglPUEVSQVRJT04SOzU5MDQyMTQ4Nzg1Mi5vcG" +
- "VyYXRpb24tMTM1MjI0NDI1ODAzMC00Y2RkYmU2YTJkNmIwLWVkMzIyMzQz&" +
- "filter=" +
- "status%20eq%20done&" +
- "maxResults=3");
- }
-
- private ListPage<Operation> zoneList() {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseZoneOperationTest().expected(url("/projects"))), // items
- null // nextPageToken
- );
- }
-
- public void listInZone() throws Exception {
- server.enqueue(jsonResponse("/zone_operation_list.json"));
-
- assertEquals(operationApi().listInZone("us-central1-a").next(), zoneList());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations");
- }
-
- public void listInZone_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(operationApi().listInZone("us-central1-a").hasNext());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations");
- }
-
- public void listPageInZone() throws Exception {
- server.enqueue(jsonResponse("/zone_operation_list.json"));
-
- assertEquals(operationApi().listPageInZone("us-central1-a",
- "CglPUEVSQVRJT04SOzU5MDQyMTQ4Nzg1Mi5vcGVyYXRpb24tMTM1MjI0NDI1ODAzMC00Y2RkYmU2YTJkNmIwLWVkMzIyMzQz",
- filter("status eq done").maxResults(3)).toString(), zoneList().toString());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations?pageToken=CglPUEVSQVRJT04SOzU5MDQyMTQ4Nzg1Mi5vcG" +
- "VyYXRpb24tMTM1MjI0NDI1ODAzMC00Y2RkYmU2YTJkNmIwLWVkMzIyMzQz&" +
- "filter=" +
- "status%20eq%20done&" +
- "maxResults=3");
- }
-
- OperationApi operationApi(){
- return api().operations();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java
deleted file mode 100644
index e4e9038..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Operation.Status;
-import org.jclouds.googlecomputeengine.domain.Project;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class ProjectApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String METADATA_ITEM_KEY = "projectLiveTestTestProp";
- private static final String METADATA_ITEM_VALUE = "projectLiveTestTestValue";
-
- private Project project;
- private int initialMetadataSize;
- private String initialFingerprint;
-
- @Test(groups = "live")
- public void getProject() {
- project = api.project().get();
- assertNotNull(project);
- assertNotNull(project.id());
- assertNotNull(project.name());
- }
-
- @Test(groups = "live", dependsOnMethods = "getProject")
- public void addItemToMetadata() {
- initialMetadataSize = project.commonInstanceMetadata().size();
- initialFingerprint = project.commonInstanceMetadata().fingerprint();
- Metadata metadata = project.commonInstanceMetadata().put(METADATA_ITEM_KEY, METADATA_ITEM_VALUE);
- assertOperationDoneSuccessfully(api.project().setCommonInstanceMetadata(metadata));
- project = api.project().get();
- assertNotNull(project);
- assertTrue(project.commonInstanceMetadata().containsKey(METADATA_ITEM_KEY), project.toString());
- assertEquals(project.commonInstanceMetadata().get(METADATA_ITEM_KEY), METADATA_ITEM_VALUE);
- assertNotNull(project.commonInstanceMetadata().fingerprint());
- }
-
- @Test(groups = "live", dependsOnMethods = "addItemToMetadata")
- public void testDeleteItemFromMetadata() {
- Metadata metadata = project.commonInstanceMetadata().remove(METADATA_ITEM_KEY);
- assertOperationDoneSuccessfully(api.project().setCommonInstanceMetadata(metadata));
- project = api.project().get();
- assertNotNull(project);
- assertFalse(project.commonInstanceMetadata().containsKey(METADATA_ITEM_KEY));
- assertEquals(project.commonInstanceMetadata().size(), initialMetadataSize);
- assertEquals(project.commonInstanceMetadata().fingerprint(), initialFingerprint);
- }
-
- @Test(groups = "live", dependsOnMethods = "getProject")
- public void testSetUsageExportBucket() {
- Operation o = api.project().setUsageExportBucket("test-bucket", "test-");
-
- while (o.status() == Status.PENDING) {
- o = api.operations().get(o.selfLink());
- }
- assertEquals(o.error().errors().get(0).code(), "PERMISSIONS_ERROR");
- assertEquals(o.error().errors().get(0).message(), "Required 'owner' permission for 'test-bucket'");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiMockTest.java
deleted file mode 100644
index b9142e2..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiMockTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseMetadataTest;
-import org.jclouds.googlecomputeengine.parse.ParseProjectTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ProjectApiMockTest", singleThreaded = true)
-public class ProjectApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/project.json"));
-
- assertEquals(projectApi().get(), new ParseProjectTest().expected(url("/projects")));
-
- assertSent(server, "GET", "/projects/party");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(projectApi().get());
-
- assertSent(server, "GET", "/projects/party");
- }
-
- public void setCommonInstanceMetadata() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- Metadata expected = new ParseMetadataTest().expected();
- assertEquals(projectApi().setCommonInstanceMetadata(expected), new ParseGlobalOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/setCommonInstanceMetadata",
- stringFromResource("/metadata.json"));
- }
-
- public void setUsageExportBucket() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- assertEquals(projectApi().setUsageExportBucket("bucket-name", "report-name-prefix"),
- new ParseGlobalOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/setUsageExportBucket",
- "{\"bucketName\": \"bucket-name\",\"reportNamePrefix\": \"report-name-prefix\"}");
- }
-
- ProjectApi projectApi() {
- return api().project();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiLiveTest.java
deleted file mode 100644
index 7ddefe9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiLiveTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class RegionApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private Region region;
-
- private RegionApi api() {
- return api.regions();
- }
-
- @Test(groups = "live")
- public void testListRegion() {
- Iterator<ListPage<Region>> pageIterator = api().list(maxResults(1));
- assertTrue(pageIterator.hasNext());
-
- List<Region> regionAsList = pageIterator.next();
-
- assertEquals(regionAsList.size(), 1);
-
- this.region = regionAsList.get(0);
- }
-
- @Test(groups = "live", dependsOnMethods = "testListRegion")
- public void testGetRegion() {
- Region region = api().get(this.region.name());
- assertNotNull(region);
- assertRegionEquals(region, this.region);
- }
-
- private void assertRegionEquals(Region result, Region expected) {
- assertEquals(result.name(), expected.name());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiMockTest.java
deleted file mode 100644
index 7312eca..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiMockTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-
-import org.jclouds.googlecomputeengine.parse.ParseRegionListTest;
-import org.jclouds.googlecomputeengine.parse.ParseRegionTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "RegionApiMockTest", singleThreaded = true)
-public class RegionApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/region_get.json"));
-
- assertEquals(regionApi().get("us-central1"), new ParseRegionTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(regionApi().get("us-central1"));
- assertSent(server, "GET", "/projects/party/regions/us-central1");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/region_list.json"));
-
- assertEquals(regionApi().list().next(), new ParseRegionListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(regionApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/regions");
- }
-
- RegionApi regionApi() {
- return api().regions();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java
deleted file mode 100644
index 8e87712..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Route;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.googlecomputeengine.options.RouteOptions;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "RouteApiLiveTest")
-public class RouteApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String DEST_RANGE = "20.10.0.0/16";
- private static final String IPV4_RANGE = "10.0.0.0/8";
- private static final String ROUTE_NAME = "route-api-live-test-route";
- private static final String ROUTE_NETWORK_NAME = "route-api-live-test-network";
-
- private RouteApi api() {
- return api.routes();
- }
-
- @Test(groups = "live")
- public void testInsertRoute() {
- assertOperationDoneSuccessfully(api.networks().createInIPv4Range
- (ROUTE_NETWORK_NAME, IPV4_RANGE));
- assertOperationDoneSuccessfully(api().createInNetwork(ROUTE_NAME,
- getNetworkUrl(ROUTE_NETWORK_NAME),
- new RouteOptions().addTag("footag")
- .addTag("bartag")
- .description("RouteApi Live Test")
- .destRange(DEST_RANGE)
- .priority(1000)
- .nextHopGateway(getGatewayUrl(DEFAULT_GATEWAY_NAME))));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertRoute")
- public void testGetRoute() {
- Route route = api().get(ROUTE_NAME);
-
- assertNotNull(route);
- assertRouteEquals(route);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetRoute")
- public void testListRoute() {
-
- Iterator<ListPage<Route>> routes = api().list(new ListOptions()
- .filter("name eq " + ROUTE_NAME));
-
- List<Route> routesAsList = routes.next();
-
- assertEquals(routesAsList.size(), 1);
-
- assertRouteEquals(routesAsList.get(0));
- }
-
- @Test(groups = "live", dependsOnMethods = "testListRoute")
- public void testDeleteRoute() {
- assertOperationDoneSuccessfully(api().delete(ROUTE_NAME));
- assertOperationDoneSuccessfully(api.networks().delete(ROUTE_NETWORK_NAME));
- }
-
- private void assertRouteEquals(Route result) {
- assertEquals(result.name(), ROUTE_NAME);
- assertEquals(result.destRange(), DEST_RANGE);
- assertEquals(result.nextHopGateway(), getGatewayUrl(DEFAULT_GATEWAY_NAME));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiMockTest.java
deleted file mode 100644
index c9d94b9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiMockTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.RouteOptions;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseRouteListTest;
-import org.jclouds.googlecomputeengine.parse.ParseRouteTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "RouteApiMockTest", singleThreaded = true)
-public class RouteApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/route_get.json"));
-
- assertEquals(routeApi().get("default-route-c99ebfbed0e1f375"),
- new ParseRouteTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/routes/default-route-c99ebfbed0e1f375");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(routeApi().get("default-route-c99ebfbed0e1f375"));
- assertSent(server, "GET", "/projects/party/global/routes/default-route-c99ebfbed0e1f375");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- assertEquals(routeApi().createInNetwork("default-route-c99ebfbed0e1f375",
- URI.create(url("/projects/party/global/networks/default")),
- new RouteOptions().addTag("fooTag")
- .addTag("barTag")
- .description("Default route to the virtual network.")
- .destRange("10.240.0.0/16")
- .priority(1000)
- .nextHopNetwork(URI.create(url("/projects/party/global/networks/default")))),
- new ParseGlobalOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/routes",
- stringFromResource("/route_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- assertEquals(routeApi().delete("default-route-c99ebfbed0e1f375"),
- new ParseGlobalOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/routes/default-route-c99ebfbed0e1f375");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(routeApi().delete("default-route-c99ebfbed0e1f375"));
- assertSent(server, "DELETE", "/projects/party/global/routes/default-route-c99ebfbed0e1f375");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/route_list.json"));
-
- assertEquals(routeApi().list().next(), new ParseRouteListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/routes");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(routeApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/routes");
- }
-
- RouteApi routeApi() {
- return api().routes();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java
deleted file mode 100644
index 57c76cb..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Snapshot;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.testng.annotations.Test;
-
-public class SnapshotApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String DISK_NAME = "snapshot-api-live-test-disk";
- private static final String SNAPSHOT_NAME = "snapshot-api-live-test-snapshot";
-
- private Disk disk;
- private SnapshotApi api() {
- return api.snapshots();
- }
-
- private DiskApi diskApi() {
- return api.disksInZone(DEFAULT_ZONE_NAME);
- }
-
- @Test(groups = "live")
- public void testCreateSnapshot() {
- assertOperationDoneSuccessfully(diskApi().create(DISK_NAME,
- new DiskCreationOptions.Builder().sizeGb(1).build()));
- disk = diskApi().get(DISK_NAME);
-
- assertOperationDoneSuccessfully(diskApi().createSnapshot(DISK_NAME, SNAPSHOT_NAME));
- }
-
- @Test(groups = "live", dependsOnMethods = "testCreateSnapshot")
- public void testGetSnapshot() {
- Snapshot snapshot = api().get(SNAPSHOT_NAME);
-
- assertEquals(snapshot.name(), SNAPSHOT_NAME);
- assertSnapshotEquals(snapshot);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetSnapshot")
- public void testListSnapshot() {
- Iterator<ListPage<Snapshot>> snapshots = api().list(filter("name eq " + SNAPSHOT_NAME));
-
- List<Snapshot> snapshotsAsList = snapshots.next();
-
- assertEquals(snapshotsAsList.size(), 1);
-
- assertSnapshotEquals(snapshotsAsList.get(0));
- }
-
- @Test(groups = "live", dependsOnMethods = "testListSnapshot")
- public void testDeleteDisk() {
- assertOperationDoneSuccessfully(diskApi().delete(DISK_NAME));
- assertOperationDoneSuccessfully(api().delete(SNAPSHOT_NAME));
- }
-
- private void assertSnapshotEquals(Snapshot result) {
- assertEquals(result.name(), SNAPSHOT_NAME);
- assertEquals(result.sourceDisk(), disk.selfLink());
- assertEquals(result.diskSizeGb(), disk.sizeGb());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiMockTest.java
deleted file mode 100644
index 9379f7a..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiMockTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseGlobalOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseSnapshotListTest;
-import org.jclouds.googlecomputeengine.parse.ParseSnapshotTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "SnapshotApiMockTest", singleThreaded = true)
-public class SnapshotApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/snapshot_get.json"));
-
- assertEquals(snapshotApi().get("test-snap"),
- new ParseSnapshotTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/snapshots/test-snap");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(snapshotApi().get("test-snap"));
- assertSent(server, "GET", "/projects/party/global/snapshots/test-snap");
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/global_operation.json"));
-
- assertEquals(snapshotApi().delete("test-snap"),
- new ParseGlobalOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/snapshots/test-snap");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(snapshotApi().delete("test-snap"));
- assertSent(server, "DELETE", "/projects/party/global/snapshots/test-snap");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/snapshot_list.json"));
-
- assertEquals(snapshotApi().list().next(), new ParseSnapshotListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/snapshots");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(snapshotApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/snapshots");
- }
-
- SnapshotApi snapshotApi() {
- return api().snapshots();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiLiveTest.java
deleted file mode 100644
index be51627..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiLiveTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.TargetHttpProxy;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.jclouds.googlecomputeengine.options.UrlMapOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class TargetHttpProxyApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String TARGET_HTTP_PROXY_NAME = "target-http-proxy-api-live-test-target-http-proxy";
- public static final String TARGET_HTTP_PROXY_URL_MAP_NAME = "target-http-proxy-api-live-test-url-map";
- public static final String URL_MAP_DEFAULT_SERVICE_NAME = "target-http-proxy-api-live-test-backend-service";
- public static final String HEALTH_CHECK_NAME = "target-http-proxy-api-live-test-health-check";
-
- private TargetHttpProxyApi api() {
- return api.targetHttpProxies();
- }
-
- @Test(groups = "live")
- public void testInsertTargetHttpProxy() {
-
- // Create resources that are required for target http proxies
-
- assertOperationDoneSuccessfully(api.httpHeathChecks().insert(HEALTH_CHECK_NAME));
-
- List<URI> healthChecks = ImmutableList.of(getHealthCheckUrl(HEALTH_CHECK_NAME));
- BackendServiceOptions b = new BackendServiceOptions.Builder(URL_MAP_DEFAULT_SERVICE_NAME, healthChecks)
- .build();
-
- assertOperationDoneSuccessfully(api.backendServices().create(b));
-
- UrlMapOptions map = new UrlMapOptions.Builder().name(TARGET_HTTP_PROXY_URL_MAP_NAME).description("simple url map")
- .defaultService(getBackendServiceUrl(URL_MAP_DEFAULT_SERVICE_NAME)).build();
- assertOperationDoneSuccessfully(api.urlMaps().create(map));
-
- UrlMapOptions map2 = new UrlMapOptions.Builder().name(TARGET_HTTP_PROXY_URL_MAP_NAME + "-2")
- .description("a second simple url map")
- .defaultService(getBackendServiceUrl(URL_MAP_DEFAULT_SERVICE_NAME))
- .build();
- assertOperationDoneSuccessfully(api.urlMaps().create(map2));
-
-
- assertOperationDoneSuccessfully(api().create(TARGET_HTTP_PROXY_NAME, getUrlMapUrl(TARGET_HTTP_PROXY_URL_MAP_NAME)));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetHttpProxy")
- public void testGetTargetHttpProxy() {
- TargetHttpProxy targetHttpProxy = api().get(TARGET_HTTP_PROXY_NAME);
- assertNotNull(targetHttpProxy);
- assertTargetHttpProxyEquals(targetHttpProxy, getUrlMapUrl(TARGET_HTTP_PROXY_URL_MAP_NAME));
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetTargetHttpProxy")
- public void testSetUrlMapTargetHttpProxy() {
- assertOperationDoneSuccessfully(api().setUrlMap(TARGET_HTTP_PROXY_NAME,
- getUrlMapUrl(TARGET_HTTP_PROXY_URL_MAP_NAME + "-2")));
- }
-
- @Test(groups = "live", dependsOnMethods = "testSetUrlMapTargetHttpProxy")
- public void testListTargetHttpProxy() {
- ListPage<TargetHttpProxy> targetHttpProxies = api().list(filter("name eq " + TARGET_HTTP_PROXY_NAME)).next();
-
- assertEquals(targetHttpProxies.size(), 1);
-
- assertTargetHttpProxyEquals(Iterables.getOnlyElement(targetHttpProxies),
- getUrlMapUrl(TARGET_HTTP_PROXY_URL_MAP_NAME + "-2"));
- }
-
- @Test(groups = "live", dependsOnMethods = "testListTargetHttpProxy", alwaysRun = true)
- public void testDeleteTargetHttpProxy() {
- assertOperationDoneSuccessfully(api().delete(TARGET_HTTP_PROXY_NAME));
-
- //remove extra resources created
- assertOperationDoneSuccessfully(api.urlMaps().delete(TARGET_HTTP_PROXY_URL_MAP_NAME));
- assertOperationDoneSuccessfully(api.urlMaps().delete(TARGET_HTTP_PROXY_URL_MAP_NAME + "-2"));
- assertOperationDoneSuccessfully(api.backendServices().delete(URL_MAP_DEFAULT_SERVICE_NAME));
- assertOperationDoneSuccessfully(api.httpHeathChecks().delete(HEALTH_CHECK_NAME));
-
- }
-
- private void assertTargetHttpProxyEquals(TargetHttpProxy result, URI urlMap) {
- assertEquals(result.name(), TARGET_HTTP_PROXY_NAME);
- assertEquals(result.urlMap(), urlMap);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiMockTest.java
deleted file mode 100644
index cd9a825..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetHttpProxyApiMockTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.TargetHttpProxyOptions;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseTargetHttpProxyListTest;
-import org.jclouds.googlecomputeengine.parse.ParseTargetHttpProxyTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "TargetHttpProxyApiMockTest", singleThreaded = true)
-public class TargetHttpProxyApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/target_http_proxy_get.json"));
-
- assertEquals(targetHttpProxyApi().get("jclouds-test"),
- new ParseTargetHttpProxyTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/targetHttpProxies/jclouds-test");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(targetHttpProxyApi().get("jclouds-test"));
- assertSent(server, "GET", "/projects/party/global/targetHttpProxies/jclouds-test");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- URI urlMap = URI.create(url("/projects/myproject/global/urlMaps/jclouds-test"));
- assertEquals(targetHttpProxyApi().create("jclouds-test", urlMap), new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/targetHttpProxies",
- stringFromResource("/target_http_proxy_insert.json"));
- }
-
- public void insert_options() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- URI urlMap = URI.create(url("/projects/myproject/global/urlMaps/jclouds-test"));
- TargetHttpProxyOptions options = new TargetHttpProxyOptions.Builder("jclouds-test", urlMap).description("test").build();
- assertEquals(targetHttpProxyApi().create(options), new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/targetHttpProxies",
- "{" +
- " \"name\": \"jclouds-test\"," +
- " \"urlMap\": \"" + url("/projects/myproject/global/urlMaps/jclouds-test") + "\"," +
- " \"description\": \"test\"" +
- "}");
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(targetHttpProxyApi().delete("jclouds-test"),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/targetHttpProxies/jclouds-test");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(targetHttpProxyApi().delete("jclouds-test"));
- assertSent(server, "DELETE", "/projects/party/global/targetHttpProxies/jclouds-test");
- }
-
- public void setUrlMap() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- URI urlMap = URI.create(url("/projects/myproject/global/urlMaps/jclouds-test"));
- assertEquals(targetHttpProxyApi().setUrlMap("jclouds-test", urlMap), new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/targetHttpProxies/jclouds-test/setUrlMap",
- stringFromResource("/target_http_proxy_set_url_map.json"));
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/target_http_proxy_list.json"));
-
- assertEquals(targetHttpProxyApi().list().next(), new ParseTargetHttpProxyListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/targetHttpProxies");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(targetHttpProxyApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/targetHttpProxies");
- }
-
- TargetHttpProxyApi targetHttpProxyApi() {
- return api().targetHttpProxies();
- }
-}
[10/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineTemplateBuilderLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineTemplateBuilderLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineTemplateBuilderLiveTest.java
deleted file mode 100644
index dbbedb3..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineTemplateBuilderLiveTest.java
+++ /dev/null
@@ -1,79 +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.compute;
-
-import static com.google.common.base.Objects.firstNonNull;
-import static org.jclouds.compute.domain.OsFamily.COREOS;
-import static org.jclouds.compute.domain.OsFamily.DEBIAN;
-import static org.jclouds.compute.domain.OsFamily.WINDOWS;
-import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest;
-import org.jclouds.googlecloud.internal.TestProperties;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = "live", testName = "GoogleComputeEngineTemplateBuilderLiveTest")
-public class GoogleComputeEngineTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
-
- public GoogleComputeEngineTemplateBuilderLiveTest() {
- provider = "google-compute-engine";
- }
-
- @Override protected Properties setupProperties() {
- TestProperties.setGoogleCredentialsFromJson(provider);
- return TestProperties.apply(provider, super.setupProperties());
- }
-
- @Test
- @Override
- public void testDefaultTemplateBuilder() throws IOException {
- Template defaultTemplate = view.getComputeService().templateBuilder().build();
- assertTrue(defaultTemplate.getImage().getOperatingSystem().getVersion().equals("7.wheezy"));
- assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), DEBIAN);
- assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
- }
-
- @Test
- public void testDefaultCredentials() {
- Map<OsFamily, String> defaultUsernames = ImmutableMap.of(COREOS, "core", WINDOWS, "Administrator");
- Set<? extends Image> images = view.getComputeService().listImages();
- for (Image image : images) {
- assertEquals(image.getDefaultCredentials().getUser(),
- firstNonNull(defaultUsernames.get(image.getOperatingSystem().getFamily()), "jclouds"));
- }
- }
-
- @Override
- protected Set<String> getIso3166Codes() {
- return ImmutableSet.<String> of();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImageTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImageTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImageTest.java
deleted file mode 100644
index 2dd99a3..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImageTest.java
+++ /dev/null
@@ -1,106 +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.compute.functions;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertSame;
-
-import java.net.URI;
-
-import org.jclouds.compute.domain.Image.Status;
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.Deprecated;
-import org.jclouds.googlecomputeengine.domain.Deprecated.State;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "GoogleComputeEngineImageToImageTest")
-public class GoogleComputeEngineImageToImageTest {
- public void testArbitraryImageName() {
- GoogleComputeEngineImageToImage imageToImage = new GoogleComputeEngineImageToImage(new ImageNameToOperatingSystem());
- Image image = image("arbitratyname", null);
- org.jclouds.compute.domain.Image transformed = imageToImage.apply(image);
- assertEquals(transformed.getName(), image.name());
- assertEquals(transformed.getId(), image.selfLink().toString());
- assertEquals(transformed.getProviderId(), image.id());
- assertSame(transformed.getOperatingSystem().getFamily(), OsFamily.LINUX);
- }
-
- public void testWellFormedImageName() {
- GoogleComputeEngineImageToImage imageToImage = new GoogleComputeEngineImageToImage(new ImageNameToOperatingSystem());
- Image image = image("ubuntu-12-04-v123123", null);
- org.jclouds.compute.domain.Image transformed = imageToImage.apply(image);
- assertEquals(transformed.getName(), image.name());
- assertEquals(transformed.getId(), image.selfLink().toString());
- assertEquals(transformed.getProviderId(), image.id());
- assertSame(transformed.getOperatingSystem().getFamily(), OsFamily.UBUNTU);
- assertEquals(transformed.getOperatingSystem().getVersion(), "12.04");
- }
-
- public void testDeleted(){
- GoogleComputeEngineImageToImage imageToImage = new GoogleComputeEngineImageToImage(new ImageNameToOperatingSystem());
- Deprecated deprecated = Deprecated.create(
- State.DELETED, // state
- URI.create("http://baseurl/projects/centos-cloud/global/images/centos-6-2-v20120326test"), // replacement
- "2014-07-16T22:16:13.468Z", // deprecated
- "2015-07-16T22:16:13.468Z", // obsolete
- "2016-07-16T22:16:13.468Z"); // deleted
- Image image = image("test-deprecated", deprecated);
- org.jclouds.compute.domain.Image transformed = imageToImage.apply(image);
- assertEquals(transformed.getName(), image.name());
- assertEquals(transformed.getId(), image.selfLink().toString());
- assertEquals(transformed.getProviderId(), image.id());
- assertSame(transformed.getOperatingSystem().getFamily(), OsFamily.LINUX);
- assertEquals(transformed.getUserMetadata().get("deprecatedState"), image.deprecated().state().name());
- assertEquals(transformed.getStatus(), Status.DELETED);
- }
-
- public void testDeprecated(){
- GoogleComputeEngineImageToImage imageToImage = new GoogleComputeEngineImageToImage(new ImageNameToOperatingSystem());
- Deprecated deprecated = Deprecated.create(
- State.DEPRECATED, // state
- URI.create("http://baseurl/projects/centos-cloud/global/images/centos-6-2-v20120326test"), // replacement
- "2014-07-16T22:16:13.468Z", // deprecated
- "2015-07-16T22:16:13.468Z", // obsolete
- "2016-07-16T22:16:13.468Z"); // deleted
- Image image = image("test-deprecated", deprecated);
- org.jclouds.compute.domain.Image transformed = imageToImage.apply(image);
- assertEquals(transformed.getStatus(), Status.AVAILABLE);
- }
-
- private static Image image(String name, Deprecated deprecated) {
- return Image.create( //
- "1234", // id
- URI.create("http://test.com/1234"), // selfLink
- new SimpleDateFormatDateService().iso8601DateParse("2012-07-16T22:16:13.468"), // creationTimestamp
- name, // name
- "", // description
- "RAW", // sourceType
- Image.RawDisk.create(URI.create("foo"), "TAR", null), // rawDisk
- deprecated, // deprecated
- Image.Status.READY, // status
- Long.parseLong("881210631", 10), // archivedSizeBytes
- Long.parseLong("8", 10), // diskSizeGb
- "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disk/disk", // sourceDisk
- "9598530021316715047", // sourceDiskId
- ImmutableList.of("https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12") // license
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystemTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystemTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystemTest.java
deleted file mode 100644
index 0d9e282..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystemTest.java
+++ /dev/null
@@ -1,52 +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.compute.functions;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.compute.domain.OsFamily;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ImageNameToOperatingSystemTest")
-public class ImageNameToOperatingSystemTest {
-
- private final ImageNameToOperatingSystem function = new ImageNameToOperatingSystem();
-
- public void testVersions() {
- assertVersion("centos-6-v20150603", OsFamily.CENTOS, "6");
- assertVersion("coreos-stable-681-0-0-v20150609", OsFamily.COREOS, "stable.681.0.0");
- assertVersion("debian-7-wheezy-v20150603", OsFamily.DEBIAN, "7.wheezy");
- assertVersion("backports-debian-7-wheezy-v20150603", OsFamily.DEBIAN, "7.wheezy");
- assertVersion("nvme-backports-debian-7-wheezy-v20140904", OsFamily.DEBIAN, "7.wheezy");
- assertVersion("opensuse-13-1-v20150515", OsFamily.SUSE, "13.1");
- assertVersion("rhel-6-v20150603", OsFamily.RHEL, "6");
- assertVersion("sles-11-sp3-v20150511", OsFamily.SUSE, "11.sp3");
- assertVersion("sles-12-v20150511", OsFamily.SUSE, "12");
- assertVersion("ubuntu-1204-precise-v20150316", OsFamily.UBUNTU, "1204.precise");
- assertVersion("windows-server-2008-r2-dc-v20150511", OsFamily.WINDOWS, "server.2008.r2.dc");
- }
-
- private void assertVersion(String name, OsFamily family, String version) {
- OperatingSystem result = function.apply(name);
- assertEquals(result.getFamily(), family);
- assertEquals(result.getVersion(), version);
- assertTrue(result.is64Bit());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadataTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadataTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadataTest.java
deleted file mode 100644
index 8fa40b0..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadataTest.java
+++ /dev/null
@@ -1,202 +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.compute.functions;
-
-import static com.google.common.collect.Maps.uniqueIndex;
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-import java.util.Map;
-import java.util.Set;
-
-import com.google.common.base.Function;
-import com.google.common.base.Functions;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Volume.Type;
-import org.jclouds.compute.domain.VolumeBuilder;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationBuilder;
-import org.jclouds.domain.LocationScope;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.parse.ParseImageTest;
-import org.jclouds.googlecomputeengine.parse.ParseInstanceTest;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "InstanceToNodeMetadataTest", singleThreaded = true) // BeforeMethod = singleThreaded
-public class InstanceToNodeMetadataTest {
-
- /**
- * GroupNamingConvention that always returns the same name provided in the constructor.
- * The predicates returned always evaluate to true.
- *
- */
- class FixedGroupNamingConvention implements GroupNamingConvention {
- private final String name;
-
- public FixedGroupNamingConvention(final String name) {
- this.name = name;
- }
-
- @Override
- public String sharedNameForGroup(final String group) {
- return name;
- }
-
- @Override
- public String uniqueNameForGroup(final String group) {
- return name;
- }
-
- @Override
- public String groupInUniqueNameOrNull(final String encoded) {
- return name;
- }
-
- @Override
- public String groupInSharedNameOrNull(final String encoded) {
- return name;
- }
-
- @Override
- public Predicate<String> containsGroup(final String group) {
- return new Predicate<String>() {
- @Override
- public boolean apply(final String input) {
- return true;
- }
- };
- }
-
- @Override
- public Predicate<String> containsAnyGroup() {
- return new Predicate<String>() {
- @Override
- public boolean apply(final String input) {
- return true;
- }
- };
- }
-
- @Override
- public String extractGroup(final String encoded) {
- return name;
- }
- }
-
- private Instance instance;
- private Set<Hardware> hardwares;
- private URI imageUrl = new ParseImageTest().expected().selfLink();
- private Set<Location> locations;
- private InstanceToNodeMetadata groupGroupNodeParser;
- private InstanceToNodeMetadata groupNullNodeParser;
-
- @BeforeMethod
- public final void setup() {
- instance = new ParseInstanceTest().expected();
-
- hardwares = ImmutableSet.of(new HardwareBuilder().id("my_id")
- .uri(URI.create("https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/"
- + "n1-standard-1"))
- .providerId("1")
- .name("mock hardware").processor(new Processor(1.0, 1.0)).ram(2048)
- .volume(new VolumeBuilder().size(20f).type(Type.LOCAL).build()).build());
-
- locations = ImmutableSet.of(new LocationBuilder()
- .id("id")
- .description("https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a")
- .scope(LocationScope.REGION)
- .parent(
- new LocationBuilder().id("0").description("mock parent location").scope(LocationScope.PROVIDER)
- .build()).build());
-
- groupGroupNodeParser = createNodeParser(hardwares, locations, "Group");
- groupNullNodeParser = createNodeParser(hardwares, locations, null);
- }
-
- private InstanceToNodeMetadata createNodeParser(final Set<Hardware> hardware, final Set<Location> locations,
- final String groupName) {
- Supplier<Map<URI, Location>> locationSupplier = new Supplier<Map<URI, Location>>() {
- @Override
- public Map<URI, Location> get() {
- return uniqueIndex(locations, new Function<Location, URI>() {
- @Override
- public URI apply(final Location input) {
- return URI.create(input.getDescription());
- }
- });
- }
- };
-
- Supplier<Map<URI, Hardware>> hardwareSupplier = Suppliers
- .<Map<URI, Hardware>>ofInstance(uniqueIndex(hardware, new Function<Hardware, URI>() {
- @Override
- public URI apply(final Hardware input) {
- return input.getUri();
- }
- }));
-
- GroupNamingConvention.Factory namingConventionFactory =
- new GroupNamingConvention.Factory() {
- @Override
- public GroupNamingConvention createWithoutPrefix() {
- return new FixedGroupNamingConvention(groupName);
- }
-
- @Override
- public GroupNamingConvention create() {
- return new FixedGroupNamingConvention(groupName);
- }
- };
-
- Map<URI, Image> imageMap = ImmutableMap.of(instance.disks().get(0).source(),
- new ParseImageTest().expected());
-
- return new InstanceToNodeMetadata(
- ImmutableMap.<Instance.Status, NodeMetadata.Status>builder()
- .put(Instance.Status.RUNNING, NodeMetadata.Status.PENDING).build(),
- namingConventionFactory,
- CacheBuilder.newBuilder().build(CacheLoader.from(Functions.forMap(imageMap))),
- hardwareSupplier,
- locationSupplier);
- }
-
- @Test
- public void imageUrl() {
- NodeMetadata nodeMetadata = groupNullNodeParser.apply(instance);
- assertEquals(nodeMetadata.getImageId(), imageUrl.toString());
- }
-
- @Test
- public final void testInstanceWithGroupNull() {
- NodeMetadata nodeMetadata = groupNullNodeParser.apply(instance);
- assertEquals(nodeMetadata.getId(), instance.selfLink().toString());
- assertEquals(nodeMetadata.getTags(), ImmutableSet.of("aTag", "Group-port-42"));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodesTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodesTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodesTest.java
deleted file mode 100644
index 9ce0d6d..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodesTest.java
+++ /dev/null
@@ -1,172 +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.compute.functions;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.testng.Assert.assertSame;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.easymock.EasyMock;
-import org.jclouds.compute.ComputeService;
-import org.jclouds.compute.domain.ComputeMetadata;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.internal.NodeMetadataImpl;
-import org.jclouds.googlecomputeengine.compute.predicates.GroupIsEmpty;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-
-public class OrphanedGroupsFromDeadNodesTest {
-
- private static class IdAndGroupOnlyNodeMetadata extends NodeMetadataImpl {
-
- public IdAndGroupOnlyNodeMetadata(String id, String group, Status status) {
- super(null, null, id, null, null, ImmutableMap.<String, String>of(), ImmutableSet.<String>of(), group, null,
- null, null, status, null, 0, ImmutableSet.<String>of(), ImmutableSet.<String>of(), null, null);
- }
- }
-
-
- @Test
- public void testDetectsNoOrphanedGroupsWhenAllNodesArePresentAndTerminated() {
-
- Set<NodeMetadata> deadNodesGroup1 = ImmutableSet.<NodeMetadata>builder()
- .add(new IdAndGroupOnlyNodeMetadata("a", "1", NodeMetadata.Status.TERMINATED)).build();
-
- Set<NodeMetadata> deadNodesGroup2 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.SUSPENDED)).build();
-
- Set<NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);
-
- ComputeService mock = createMock(ComputeService.class);
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) deadNodesGroup1).once();
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) deadNodesGroup2).once();
-
- replay(mock);
-
- OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(
- allNodesInGroupTerminated(mock));
-
- Set<String> orphanedGroups = orphanedGroupsFromDeadNodes.apply(allDeadNodes);
-
- assertTrue(orphanedGroups.isEmpty());
- }
-
- @Test
- public void testDetectsOneOrphanedGroupWhenSomeNodesTerminatedAndOtherMissing() {
-
- Set<NodeMetadata> deadNodesGroup1 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("a", "1", NodeMetadata.Status.TERMINATED)).build();
-
- Set<NodeMetadata> deadNodesGroup2 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.TERMINATED)).build();
-
- Set<NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);
-
- ComputeService mock = createMock(ComputeService.class);
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) deadNodesGroup1).once();
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) ImmutableSet.of()).once();
-
- replay(mock);
-
- OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(
- allNodesInGroupTerminated(mock));
-
- Set<String> orphanedGroups = orphanedGroupsFromDeadNodes.apply(allDeadNodes);
-
- assertSame(orphanedGroups.size(), 1);
- assertTrue(orphanedGroups.contains("2"));
- }
-
- @Test
- public void testDetectsOneOrphanedGroupWhenSomeNodesAreAliveAndOtherMissing() {
-
- Set<NodeMetadata> deadNodesGroup1 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("a", "1", NodeMetadata.Status.RUNNING)).build();
-
- Set<NodeMetadata> deadNodesGroup2 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.TERMINATED)).build();
-
- Set<NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);
-
- ComputeService mock = createMock(ComputeService.class);
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) deadNodesGroup1).once();
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) ImmutableSet.of()).once();
-
- replay(mock);
-
- OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(
- allNodesInGroupTerminated(mock));
-
- Set<String> orphanedGroups = orphanedGroupsFromDeadNodes.apply(allDeadNodes);
-
- assertSame(orphanedGroups.size(), 1);
- assertTrue(orphanedGroups.contains("2"));
- }
-
- @Test
- public void testDetectsAllOrphanedGroupsWhenAllNodesArerMissing() {
-
- Set<NodeMetadata> deadNodesGroup1 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("a", "1", NodeMetadata.Status.RUNNING)).build();
-
- Set<NodeMetadata> deadNodesGroup2 = ImmutableSet.<NodeMetadata> builder()
- .add(new IdAndGroupOnlyNodeMetadata("b", "2", NodeMetadata.Status.TERMINATED)).build();
-
- Set<NodeMetadata> allDeadNodes = Sets.union(deadNodesGroup1, deadNodesGroup2);
-
- ComputeService mock = createMock(ComputeService.class);
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) ImmutableSet.of()).once();
- expect(mock.listNodesDetailsMatching(EasyMock.<Predicate<ComputeMetadata>>anyObject()))
- .andReturn((Set) ImmutableSet.of()).once();
-
- replay(mock);
-
- OrphanedGroupsFromDeadNodes orphanedGroupsFromDeadNodes = new OrphanedGroupsFromDeadNodes(
- allNodesInGroupTerminated(mock));
-
- Set<String> orphanedGroups = orphanedGroupsFromDeadNodes.apply(allDeadNodes);
-
- assertSame(orphanedGroups.size(), 2);
- assertTrue(orphanedGroups.contains("1"));
- assertTrue(orphanedGroups.contains("2"));
- }
-
- private Predicate<String> allNodesInGroupTerminated(final ComputeService mock) {
- return Guice.createInjector(new AbstractModule() {
- @Override protected void configure() {
- bind(ComputeService.class).toInstance(mock);
- }
- }).getInstance(GroupIsEmpty.class); // rather than opening ctor.
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResourcesMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResourcesMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResourcesMockTest.java
deleted file mode 100644
index fb2ed04..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResourcesMockTest.java
+++ /dev/null
@@ -1,162 +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.compute.functions;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseDiskTest;
-import org.jclouds.googlecomputeengine.parse.ParseImageTest;
-import org.jclouds.googlecomputeengine.parse.ParseInstanceTest;
-import org.jclouds.googlecomputeengine.parse.ParseNetworkTest;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ResourcesMockTest", singleThreaded = true)
-public class ResourcesMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void testInstance() throws Exception {
- server.enqueue(jsonResponse("/instance_get.json"));
-
- Instance instance = resourceApi().instance(server.getUrl("/foo/bar").toURI());
- assertEquals(instance, new ParseInstanceTest().expected(url("/projects")));
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testInstanceReturns404() throws Exception {
- server.enqueue(response404());
-
- Instance instance = resourceApi().instance(server.getUrl("/foo/bar").toURI());
- assertNull(instance);
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testNetwork() throws Exception {
- server.enqueue(jsonResponse("/network_get.json"));
-
- Network network = resourceApi().network(server.getUrl("/foo/bar").toURI());
- assertEquals(network, new ParseNetworkTest().expected(url("/projects")));
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testNetworkReturns404() throws Exception {
- server.enqueue(response404());
-
- Network network = resourceApi().network(server.getUrl("/foo/bar").toURI());
- assertNull(network);
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testDisk() throws Exception {
- server.enqueue(jsonResponse("/disk_get.json"));
-
- Disk disk = resourceApi().disk(server.getUrl("/foo/bar").toURI());
- assertEquals(disk, new ParseDiskTest().expected(url("/projects")));
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testDiskReturns404() throws Exception {
- server.enqueue(response404());
-
- Disk disk = resourceApi().disk(server.getUrl("/foo/bar").toURI());
- assertNull(disk);
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testImage() throws Exception {
- server.enqueue(jsonResponse("/image_get.json"));
-
- Image image = resourceApi().image(server.getUrl("/foo/bar").toURI());
- assertEquals(image, new ParseImageTest().expected(url("/projects")));
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testImageReturns404() throws Exception {
- server.enqueue(response404());
-
- Image image = resourceApi().image(server.getUrl("/foo/bar").toURI());
- assertNull(image);
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testOperation() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- Operation operation = resourceApi().operation(server.getUrl("/foo/bar").toURI());
- assertEquals(operation, new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testOperationReturns404() throws Exception {
- server.enqueue(response404());
-
- Operation operation = resourceApi().operation(server.getUrl("/foo/bar").toURI());
- assertNull(operation);
- assertSent(server, "GET", "/foo/bar");
- }
-
- public void testDelete() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- Operation operation = resourceApi().delete(server.getUrl("/foo/bar").toURI());
- assertEquals(operation, new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/foo/bar");
- }
-
- public void testDeleteReturns404() throws Exception {
- server.enqueue(response404());
-
- Operation operation = resourceApi().delete(server.getUrl("/foo/bar").toURI());
- assertNull(operation);
- assertSent(server, "DELETE", "/foo/bar");
- }
-
- public void testResetInstance() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- Operation operation = resourceApi().resetInstance(server.getUrl("/foo/bar").toURI());
- assertEquals(operation, new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/foo/bar/reset");
- }
-
- public void testStopInstance() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- Operation operation = resourceApi().stopInstance(server.getUrl("/foo/bar").toURI());
- assertEquals(operation, new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/foo/bar/stop");
- }
-
- public void testStartInstance() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- Operation operation = resourceApi().startInstance(server.getUrl("/foo/bar").toURI());
- assertEquals(operation, new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/foo/bar/start");
- }
-
- private Resources resourceApi() {
- return builder().build().utils().injector().getInstance(Resources.class);
- }
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/config/UseApiToResolveProjectNameMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/config/UseApiToResolveProjectNameMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/config/UseApiToResolveProjectNameMockTest.java
deleted file mode 100644
index 25f3431..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/config/UseApiToResolveProjectNameMockTest.java
+++ /dev/null
@@ -1,76 +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;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.fail;
-
-import java.net.URI;
-
-import org.jclouds.domain.Credentials;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApiMetadata;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "UseApiToResolveProjectSelfLinkMockTest", singleThreaded = true)
-public class UseApiToResolveProjectNameMockTest extends BaseGoogleComputeEngineApiMockTest {
- private final String projectNumber = "761326798069";
-
- public void validClientEmail() throws Exception {
- server.enqueue(jsonResponse("/project.json"));
-
- URI projectSelfLink = fn().apply(new Credentials(projectNumber + "@developer.gserviceaccount.com", credential));
-
- assertEquals(projectSelfLink.toString(), url("/projects/party"));
-
- assertSent(server, "GET", "/projects/" + projectNumber);
- }
-
- public void validClientEmail_extendedUid() throws Exception {
- server.enqueue(jsonResponse("/project.json"));
-
- URI projectSelfLink = fn().apply(
- new Credentials(projectNumber + "-r5mljlln1rd4lrbhg75efgigp36m78j5@developer.gserviceaccount.com", credential));
-
- assertEquals(projectSelfLink.toString(), url("/projects/party"));
-
- assertSent(server, "GET", "/projects/" + projectNumber);
- }
-
- /**
- * We do not support just supplying the projectNumber, as this causes confusion when using oauth. OAuth JWT requires
- * the whole email for the ISS field. This is better than confusing users with instructions like "Use the email,
- * except if using bearer token. Then, you don't need the entire email, just put in the numeric id part of it."
- */
- public void justProjectIdIsInvalid() throws Exception {
- server.enqueue(jsonResponse("/project.json"));
-
- try {
- fn().apply(new Credentials(projectNumber, credential));
- fail();
- } catch (IllegalArgumentException e) {
- assertEquals(e.getMessage(), String.format("Client email %s is malformed. Should be %s", projectNumber,
- new GoogleComputeEngineApiMetadata().getIdentityName()));
- }
-
- assertEquals(server.getRequestCount(), 0);
- }
-
- GoogleComputeEngineHttpApiModule.UseApiToResolveProjectName fn() {
- return builder().buildInjector().getInstance(GoogleComputeEngineHttpApiModule.UseApiToResolveProjectName.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java
deleted file mode 100644
index cee41f6..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class AddressApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String ADDRESS_NAME = "address-api-live-test-address";
-
- private AddressApi api() {
- return api.addressesInRegion(DEFAULT_REGION_NAME);
- }
-
- @Test(groups = "live")
- public void testInsertAddress() {
- assertOperationDoneSuccessfully(api().create(ADDRESS_NAME));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertAddress")
- public void testGetAddress() {
- Address address = api().get(ADDRESS_NAME);
- assertNotNull(address);
- assertEquals(address.name(), ADDRESS_NAME);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetAddress")
- public void testListAddress() {
- Iterator<ListPage<Address>> addresses = api().list(filter("name eq " + ADDRESS_NAME));
- assertEquals(addresses.next().size(), 1);
- }
-
- @Test(groups = "live", dependsOnMethods = "testListAddress")
- public void testDeleteAddress() {
- assertOperationDoneSuccessfully(api().delete(ADDRESS_NAME));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiMockTest.java
deleted file mode 100644
index 0fdca5b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiMockTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.AddressCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseAddressListTest;
-import org.jclouds.googlecomputeengine.parse.ParseAddressTest;
-import org.jclouds.googlecomputeengine.parse.ParseRegionOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "AddressApiExpectTest", singleThreaded = true)
-public class AddressApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception{
- server.enqueue(jsonResponse("/address_get.json"));
-
- assertEquals(addressApi().get("test-ip1"), new ParseAddressTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1/addresses/test-ip1");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(addressApi().get("test-ip1"));
- assertSent(server, "GET", "/projects/party/regions/us-central1/addresses/test-ip1");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- assertEquals(addressApi().create("test-ip1"),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/addresses",
- stringFromResource("/address_insert.json"));
- }
-
- public void insert_options() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- AddressCreationOptions options = new AddressCreationOptions.Builder("address-with-options")
- .description("This is a test").address("1.1.1.1").build();
- assertEquals(addressApi().create(options),
- new ParseRegionOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/regions/us-central1/addresses",
- "{\"name\": \"address-with-options\",\"description\":\"This is a test\",\"address\":\"1.1.1.1\"}");
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- assertEquals(addressApi().delete("test-ip1"),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/regions/us-central1/addresses/test-ip1");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(addressApi().delete("test-ip1"));
- assertSent(server, "DELETE", "/projects/party/regions/us-central1/addresses/test-ip1");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/address_list.json"));
-
- assertEquals(addressApi().list().next(), new ParseAddressListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1/addresses");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(addressApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/regions/us-central1/addresses");
- }
-
- AddressApi addressApi(){
- return api().addressesInRegion("us-central1");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiLiveTest.java
deleted file mode 100644
index d7121b2..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiLiveTest.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.TargetInstance;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.SkipException;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "AggregatedListApiLiveTest")
-public class AggregatedListApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String DISK_NAME = "aggregated-list-api-live-test-disk";
- public static final int sizeGb = 1;
-
- private AggregatedListApi api() {
- return api.aggregatedList();
- }
-
- public void machineTypes() {
- Iterator<ListPage<MachineType>> pageIterator = api().machineTypes(maxResults(1));
- assertTrue(pageIterator.hasNext());
-
- List<MachineType> machineTypeAsList = pageIterator.next();
-
- assertEquals(machineTypeAsList.size(), 1);
- }
-
- public void addresses() {
- Iterator<ListPage<Address>> pageIterator = api().addresses(maxResults(1));
- // make sure that in spite of having only one result per page we get at
- // least two results
- int count = 0;
- for (; count < 2 && pageIterator.hasNext();) {
- ListPage<Address> result = pageIterator.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough addresses");
- }
- assertEquals(count, 2);
- }
-
- public void disks() {
- Iterator<ListPage<Disk>> pageIterator = api().disks(maxResults(1));
- // make sure that in spite of having only one result per page we get at
- // least two results
- int count = 0;
- for (; count < 2 && pageIterator.hasNext();) {
- ListPage<Disk> result = pageIterator.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough disks");
- }
- assertEquals(count, 2);
- }
-
- public void diskTypes() {
- Iterator<ListPage<DiskType>> pageIterator = api().diskTypes(maxResults(1));
- assertTrue(pageIterator.hasNext());
-
- List<DiskType> diskTypeAsList = pageIterator.next();
-
- assertEquals(diskTypeAsList.size(), 1);
- }
-
- public void globalOperations() {
- Iterator<ListPage<Operation>> pageIterator = api().globalOperations(maxResults(1));
- // make sure that in spite of having only one result per page we get at
- // least two results
- int count = 0;
- for (; count < 2 && pageIterator.hasNext();) {
- ListPage<Operation> result = pageIterator.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough global operations");
- }
- assertEquals(count, 2);
- }
-
- public void forwardingRules() {
- Iterator<ListPage<ForwardingRule>> pageIterator = api().forwardingRules(maxResults(1));
- // make sure that in spite of having only one result per page we get at
- // least two results
- int count = 0;
- for (; count < 2 && pageIterator.hasNext();) {
- ListPage<ForwardingRule> result = pageIterator.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough forwarding rules");
- }
- assertEquals(count, 2);
- }
-
- public void targetInstances() {
- Iterator<ListPage<TargetInstance>> pageIterator = api().targetInstances(maxResults(1));
- // make sure that in spite of having only one result per page we get at
- // least two results
- int count = 0;
- for (; count < 2 && pageIterator.hasNext();) {
- ListPage<TargetInstance> result = pageIterator.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough target instances");
- }
- assertEquals(count, 2);
- }
-
- public void targetPools() {
- Iterator<ListPage<TargetPool>> pageIterator = api().targetPools(maxResults(1));
- // make sure that in spite of having only one result per page we get at
- // least two results
- int count = 0;
- for (; count < 2 && pageIterator.hasNext();) {
- ListPage<TargetPool> result = pageIterator.next();
- if (!result.isEmpty()) {
- count++;
- }
- }
- if (count < 2) {
- throw new SkipException("Not enough target pools");
- }
- assertEquals(count, 2);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiMockTest.java
deleted file mode 100644
index 1d8bf0a..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiMockTest.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "AggregatedListApiMockTest", singleThreaded = true)
-public class AggregatedListApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void machineTypes() throws Exception {
- server.enqueue(jsonResponse("/aggregated_machinetype_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.machineTypes().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes");
- }
-
- public void machineTypes_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_instance_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.machineTypes().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes");
- }
-
- public void instances() throws Exception {
- server.enqueue(jsonResponse("/aggregated_instance_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.instances().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/instances");
- }
-
- public void instances_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_instance_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.instances().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/instances");
- }
-
- public void addresses() throws Exception {
- server.enqueue(jsonResponse("/aggregated_address_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.addresses().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/addresses");
- }
-
- public void addresses_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_address_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.addresses().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/addresses");
- }
-
- public void disks() throws Exception {
- server.enqueue(jsonResponse("/aggregated_disk_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.disks().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/disks");
- }
-
- public void disks_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_disk_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.disks().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/disks");
- }
-
- public void diskTypes() throws Exception {
- server.enqueue(jsonResponse("/aggregated_disktype_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.diskTypes().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/diskTypes");
- }
-
- public void diskTypes_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_disktype_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.diskTypes().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/diskTypes");
- }
-
- public void globalOperations() throws Exception {
- server.enqueue(jsonResponse("/aggregated_global_operation_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.globalOperations().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/operations");
- }
-
- public void globalOperations_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_global_operation_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.globalOperations().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/operations");
- }
-
- public void forwardingRules() throws Exception {
- server.enqueue(jsonResponse("/aggregated_forwarding_rule_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.forwardingRules().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/forwardingRules");
- }
-
- public void forwardingRules_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_forwarding_rule_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.forwardingRules().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/forwardingRules");
- }
-
- public void targetInstances() throws Exception {
- server.enqueue(jsonResponse("/aggregated_target_instance_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.targetInstances().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/targetInstances");
- }
-
- public void targetInstances_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_target_instance_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.targetInstances().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/targetInstances");
- }
-
- public void targetPools() throws Exception {
- server.enqueue(jsonResponse("/aggregated_target_pool_list.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertTrue(aggregatedList.targetPools().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/targetPools");
- }
-
- public void targetPools_4xx() throws Exception {
- server.enqueue(jsonResponse("/aggregated_target_pool_list_empty.json"));
-
- AggregatedListApi aggregatedList = api().aggregatedList();
-
- assertFalse(aggregatedList.targetPools().hasNext());
-
- assertSent(server, "GET", "/projects/party/aggregated/targetPools");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java
deleted file mode 100644
index 9ed6ceb..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static com.google.common.collect.Iterables.getOnlyElement;
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.BackendService;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-public class BackendServiceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String BACKEND_SERVICE_NAME = "backend-service-api-live-test-backend-service";
- private static final String BACKEND_SERVICE_HEALTH_CHECK_NAME = "backend-service-api-live-test-health-check";
-
- private BackendServiceApi api() {
- return api.backendServices();
- }
-
- @Test(groups = "live")
- public void testInsertBackendService() {
- assertOperationDoneSuccessfully(api.httpHeathChecks().insert(BACKEND_SERVICE_HEALTH_CHECK_NAME));
-
- List<URI> healthChecks = ImmutableList.of(getHealthCheckUrl(BACKEND_SERVICE_HEALTH_CHECK_NAME));
-
- BackendServiceOptions b = new BackendServiceOptions.Builder(BACKEND_SERVICE_NAME, healthChecks).build();
- assertOperationDoneSuccessfully(api().create(b));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertBackendService")
- public void testGetBackendService() {
- BackendService service = api().get(BACKEND_SERVICE_NAME);
- assertNotNull(service);
- assertBackendServiceEquals(service);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetBackendService")
- public void testPatchBackendService() {
- String fingerprint = api().get(BACKEND_SERVICE_NAME).fingerprint();
- BackendServiceOptions backendService = new BackendServiceOptions.Builder(BACKEND_SERVICE_NAME, ImmutableList.of(getHealthCheckUrl(BACKEND_SERVICE_HEALTH_CHECK_NAME)))
- .timeoutSec(10)
- .fingerprint(fingerprint)
- .build();
-
- assertOperationDoneSuccessfully(api().update(BACKEND_SERVICE_NAME, backendService));
- assertBackendServiceEquals(api().get(BACKEND_SERVICE_NAME), backendService);
- }
-
- @Test(groups = "live", dependsOnMethods = "testPatchBackendService")
- public void testUpdateBackendService() {
- String fingerprint = api().get(BACKEND_SERVICE_NAME).fingerprint();
-
- BackendServiceOptions backendService = new BackendServiceOptions.Builder(BACKEND_SERVICE_NAME, ImmutableList.of(getHealthCheckUrl(BACKEND_SERVICE_HEALTH_CHECK_NAME)))
- .timeoutSec(45)
- .port(8080)
- .fingerprint(fingerprint)
- .build();
-
- assertOperationDoneSuccessfully(api().update(BACKEND_SERVICE_NAME, backendService));
- assertBackendServiceEquals(api().get(BACKEND_SERVICE_NAME),
- backendService);
- }
-
- @Test(groups = "live", dependsOnMethods = "testUpdateBackendService")
- public void testListBackendService() {
- Iterator<ListPage<BackendService>> backendServices = api().list(filter("name eq " + BACKEND_SERVICE_NAME));
-
- List<BackendService> backendServicesAsList = backendServices.next();
-
- assertEquals(backendServicesAsList.size(), 1);
-
- }
-
- /*
- @Test(groups = "live", dependsOnMethods = "testListBackendService")
- public void testGetHealthBackendService() {
- // TODO: Once resourceViews are merged into the project. Test this actually works.
- }
- */
-
- @Test(groups = "live", dependsOnMethods = "testListBackendService")
- public void testDeleteBackendService() {
- assertOperationDoneSuccessfully(api().delete(BACKEND_SERVICE_NAME));
-
- assertOperationDoneSuccessfully(api.httpHeathChecks().delete(BACKEND_SERVICE_HEALTH_CHECK_NAME));
-
- }
-
- private void assertBackendServiceEquals(BackendService result) {
- assertEquals(result.name(), BACKEND_SERVICE_NAME);
- assertEquals(getOnlyElement(result.healthChecks()),
- getHealthCheckUrl(BACKEND_SERVICE_HEALTH_CHECK_NAME));
- }
-
- private void assertBackendServiceEquals(BackendService result, BackendServiceOptions expected) {
- assertEquals(result.name(), expected.name());
- assertEquals(result.healthChecks(), expected.healthChecks());
- if (expected.timeoutSec() != null) {
- org.testng.Assert.assertEquals(result.timeoutSec(), expected.timeoutSec().intValue());
- }
- if (expected.port() != null) {
- org.testng.Assert.assertEquals(result.port(), expected.port().intValue());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
deleted file mode 100644
index fd9a639..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiMockTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.jclouds.googlecomputeengine.parse.ParseHealthStatusTest;
-import org.jclouds.googlecomputeengine.parse.ParseBackendServiceListTest;
-import org.jclouds.googlecomputeengine.parse.ParseBackendServiceTest;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "BackendServiceApiMockTest", singleThreaded = true)
-public class BackendServiceApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/backend_service_get.json"));
-
- assertEquals(backendServiceApi().get("jclouds-test"),
- new ParseBackendServiceTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/backendServices/jclouds-test");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(backendServiceApi().get("jclouds-test"));
- assertSent(server, "GET", "/projects/party/global/backendServices/jclouds-test");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- List<URI> healthChecks = ImmutableList.of(URI.create(url("/projects/"
- + "myproject/global/httpHealthChecks/jclouds-test")));
-
- assertEquals(backendServiceApi().create( new BackendServiceOptions.Builder("jclouds-test", healthChecks)
- .protocol("HTTP")
- .port(80)
- .timeoutSec(30)
- .build()),
- new ParseOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/global/backendServices",
- stringFromResource("/backend_service_insert.json"));
- }
-
- public void update() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- List<URI> healthChecks = ImmutableList.of(URI.create(url("/projects/"
- + "myproject/global/httpHealthChecks/jclouds-test")));
-
- assertEquals(backendServiceApi().update("jclouds-test",
- new BackendServiceOptions.Builder("jclouds-test", healthChecks)
- .protocol("HTTP")
- .port(80)
- .timeoutSec(30)
- .build()),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "PUT", "/projects/party/global/backendServices/jclouds-test",
- stringFromResource("/backend_service_insert.json"));
- }
-
- public void patch() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- List<URI> healthChecks = ImmutableList.of(URI.create(url("/projects/"
- + "myproject/global/httpHealthChecks/jclouds-test")));
-
- assertEquals(backendServiceApi().patch("jclouds-test",
- new BackendServiceOptions.Builder("jclouds-test", healthChecks)
- .protocol("HTTP")
- .port(80)
- .timeoutSec(30)
- .build()),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "PATCH", "/projects/party/global/backendServices/jclouds-test",
- stringFromResource("/backend_service_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(backendServiceApi().delete("jclouds-test"),
- new ParseOperationTest().expected(url("/projects")));
-
- assertSent(server, "DELETE", "/projects/party/global/backendServices/jclouds-test");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(backendServiceApi().delete("jclouds-test"));
-
- assertSent(server, "DELETE", "/projects/party/global/backendServices/jclouds-test");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/backend_service_list.json"));
-
- assertEquals(backendServiceApi().list().next(), new ParseBackendServiceListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/backendServices");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(backendServiceApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/backendServices");
- }
-
- public void getHealth() throws Exception {
- server.enqueue(jsonResponse("/health_status_get_health.json"));
-
- URI group = URI.create("https://www.googleapis.com/resourceviews/v1beta1/"
- + "projects/myproject/zones/us-central1-a/"
- + "resourceViews/jclouds-test");
- assertEquals(backendServiceApi().getHealth("jclouds-test", group),
- new ParseHealthStatusTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/global/backendServices/jclouds-test/getHealth",
- stringFromResource("/backend_service_get_health_request.json"));
- }
-
- public BackendServiceApi backendServiceApi(){
- return api().backendServices();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java
deleted file mode 100644
index ec020bc..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.testng.annotations.Test;
-
-public class DiskApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String DISK_NAME = "disk-api-live-test-disk";
- public static final String SSD_DISK_NAME = "disk-api-live-test-disk-ssd";
- public static final int SIZE_GB = 1;
-
- private DiskApi api() {
- return api.disksInZone(DEFAULT_ZONE_NAME);
- }
-
- @Test(groups = "live")
- public void testInsertDisk() {
- DiskCreationOptions options = new DiskCreationOptions.Builder().sizeGb( SIZE_GB).build();
- assertOperationDoneSuccessfully(api().create(DISK_NAME, options));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertDisk")
- public void testGetDisk() {
- Disk disk = api().get(DISK_NAME);
- assertNotNull(disk);
- assertDiskEquals(disk);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetDisk")
- public void testListDisk() {
- Iterator<ListPage<Disk>> disks = api().list(filter("name eq " + DISK_NAME));
-
- List<Disk> disksAsList = disks.next();
-
- assertEquals(disksAsList.size(), 1);
-
- assertDiskEquals(disksAsList.get(0));
- }
-
- @Test(groups = "live", dependsOnMethods = "testListDisk")
- public void testDeleteDisk() {
- assertOperationDoneSuccessfully(api().delete(DISK_NAME));
- }
-
- private void assertDiskEquals(Disk result) {
- assertEquals(result.name(), DISK_NAME);
- assertEquals(result.sizeGb(), SIZE_GB);
- assertEquals(result.zone(), getDefaultZoneUrl());
- }
-
- @Test(groups = "live")
- public void testInsertSSDDisk() {
- URI diskType = getDiskTypeUrl(DEFAULT_ZONE_NAME, "pd-ssd");
- DiskCreationOptions diskCreationOptions = new DiskCreationOptions.Builder().type(diskType).sizeGb(SIZE_GB).build();
- assertOperationDoneSuccessfully(api().create(SSD_DISK_NAME, diskCreationOptions));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertSSDDisk")
- public void testGetSSDDisk() {
- Disk disk = api().get(SSD_DISK_NAME);
- assertNotNull(disk);
- assertSSDDiskEquals(disk);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetSSDDisk")
- public void testDeleteSSDDisk() {
- assertOperationDoneSuccessfully(api().delete(SSD_DISK_NAME));
- }
-
- private void assertSSDDiskEquals(Disk result) {
- assertEquals(result.name(), SSD_DISK_NAME);
- assertEquals(result.sizeGb(), SIZE_GB);
- assertEquals(result.zone(), getDefaultZoneUrl());
- assertEquals(result.type(), getDiskTypeUrl(DEFAULT_ZONE_NAME, "pd-ssd"));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiMockTest.java
deleted file mode 100644
index 13f9d25..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiMockTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseDiskListTest;
-import org.jclouds.googlecomputeengine.parse.ParseDiskTest;
-import org.jclouds.googlecomputeengine.parse.ParseZoneOperationTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "DiskApiMockTest", singleThreaded = true)
-public class DiskApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public static final String IMAGE_URL = "/projects/party/zones/us-central1-a/images/foo";
- public static final String SSD_URL = "/projects/party/zones/us-central1-a/diskTypes/pd-ssd";
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/disk_get.json"));
-
- assertEquals(diskApi().get("testimage1"), new ParseDiskTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks/testimage1");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(diskApi().get("testimage1"));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks/testimage1");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- DiskCreationOptions options = new DiskCreationOptions.Builder().sizeGb(1).build();
- assertEquals(diskApi().create("testimage1", options),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/disks",
- stringFromResource("/disk_insert.json"));
- }
-
- public void insertFromImage() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- DiskCreationOptions diskCreationOptions = new DiskCreationOptions.Builder().sizeGb(1).description("testing 123").build();
-
- assertEquals(diskApi().create("testimage1", url(IMAGE_URL), diskCreationOptions),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/disks?sourceImage="
- + url("/projects/party/zones/us-central1-a/images/foo").replace(":", "%3A"), //TODO (broudy) clean this up.
- "{\"name\":\"testimage1\",\"sizeGb\":1,\"description\":\"testing 123\"}");
- }
-
- public void insertFromSSD() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- DiskCreationOptions diskCreationOptions = new DiskCreationOptions.Builder()
- .type(URI.create(url(SSD_URL))).sizeGb(1).build();
-
- assertEquals(diskApi().create("testimage1", diskCreationOptions),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/disks",
- stringFromResource("/disk_insert_ssd.json"));
- }
-
- public void creatSnapshot() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(diskApi().createSnapshot("testimage1", "test-snap"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/disks/testimage1/createSnapshot",
- stringFromResource("/disk_create_snapshot.json"));
- }
-
- public void creatSnapshot_description() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(diskApi().createSnapshot("testimage1", "test-snap", "This is a test"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/disks/testimage1/createSnapshot",
- "{\"name\":\"test-snap\",\"description\":\"This is a test\"}");
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- assertEquals(diskApi().delete("testimage1"),
- new ParseZoneOperationTest().expected(url("/projects")));
-
- assertSent(server, "DELETE", "/projects/party/zones/us-central1-a/disks/testimage1");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(diskApi().delete("testimage1"));
- assertSent(server, "DELETE", "/projects/party/zones/us-central1-a/disks/testimage1");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/disk_list.json"));
-
- assertEquals(diskApi().list().next(), new ParseDiskListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(diskApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks");
- }
-
- public DiskApi diskApi(){
- return api().disksInZone("us-central1-a");
- }
-}
[17/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
Remove the graduated GCE provided and updated Maven coordinates
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/commit/cf9af834
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/tree/cf9af834
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/diff/cf9af834
Branch: refs/heads/master
Commit: cf9af834481c3c649136a275a0634ff4e0ab36d5
Parents: 413b03b
Author: Ignasi Barrera <na...@apache.org>
Authored: Fri Jun 26 14:51:07 2015 +0200
Committer: Ignasi Barrera <na...@apache.org>
Committed: Fri Jun 26 14:51:07 2015 +0200
----------------------------------------------------------------------
CONTRIBUTING.md | 2 +
README.md | 4 +-
google-cloud-storage/pom.xml | 4 +-
google-compute-engine/README.md | 70 ---
google-compute-engine/pom.xml | 170 -------
.../GoogleComputeEngineApi.java | 163 ------
.../GoogleComputeEngineApiMetadata.java | 101 ----
.../GoogleComputeEngineFallbacks.java | 36 --
.../GoogleComputeEngineProviderMetadata.java | 72 ---
.../binders/DiskCreationBinder.java | 58 ---
.../binders/FirewallBinder.java | 47 --
.../binders/ForwardingRuleCreationBinder.java | 73 ---
.../binders/HttpHealthCheckCreationBinder.java | 78 ---
.../binders/RouteBinder.java | 47 --
.../TargetPoolChangeHealthChecksBinder.java | 28 --
.../TargetPoolChangeInstancesBinder.java | 28 --
.../TargetPoolMapofListofMapGenericBinder.java | 66 ---
.../compute/GoogleComputeEngineService.java | 183 -------
.../GoogleComputeEngineServiceAdapter.java | 318 ------------
...GoogleComputeEngineServiceContextModule.java | 221 --------
.../functions/FirewallTagNamingConvention.java | 59 ---
.../GoogleComputeEngineImageToImage.java | 59 ---
.../functions/ImageNameToOperatingSystem.java | 65 ---
.../functions/InstanceToNodeMetadata.java | 114 -----
.../functions/MachineTypeToHardware.java | 83 ---
.../functions/OrphanedGroupsFromDeadNodes.java | 51 --
.../compute/functions/Resources.java | 94 ----
.../compute/loaders/DiskURIToImage.java | 57 ---
.../GoogleComputeEngineTemplateOptions.java | 283 -----------
.../predicates/AtomicInstanceVisible.java | 44 --
.../compute/predicates/AtomicOperationDone.java | 53 --
.../compute/predicates/GroupIsEmpty.java | 42 --
...desWithGroupEncodedIntoNameThenAddToSet.java | 233 ---------
.../GoogleComputeEngineHttpApiModule.java | 143 ------
.../config/GoogleComputeEngineParserModule.java | 137 -----
.../config/GoogleComputeEngineProperties.java | 39 --
.../googlecomputeengine/domain/Address.java | 69 ---
.../googlecomputeengine/domain/AttachDisk.java | 132 -----
.../domain/BackendService.java | 103 ----
.../googlecomputeengine/domain/Deprecated.java | 64 ---
.../googlecomputeengine/domain/Disk.java | 77 ---
.../googlecomputeengine/domain/DiskType.java | 56 ---
.../googlecomputeengine/domain/Firewall.java | 109 ----
.../domain/ForwardingRule.java | 88 ----
.../domain/HealthStatus.java | 56 ---
.../domain/HttpHealthCheck.java | 75 ---
.../googlecomputeengine/domain/Image.java | 106 ----
.../googlecomputeengine/domain/Instance.java | 262 ----------
.../domain/KeyValuePair.java | 37 --
.../googlecomputeengine/domain/License.java | 40 --
.../googlecomputeengine/domain/MachineType.java | 87 ----
.../googlecomputeengine/domain/Metadata.java | 118 -----
.../googlecomputeengine/domain/Network.java | 63 ---
.../googlecomputeengine/domain/NewInstance.java | 180 -------
.../domain/NewTargetInstance.java | 72 ---
.../googlecomputeengine/domain/Operation.java | 148 ------
.../googlecomputeengine/domain/Project.java | 80 ---
.../googlecomputeengine/domain/Quota.java | 41 --
.../googlecomputeengine/domain/Region.java | 62 ---
.../googlecomputeengine/domain/Route.java | 88 ----
.../googlecomputeengine/domain/Snapshot.java | 75 ---
.../googlecomputeengine/domain/Tags.java | 55 --
.../domain/TargetHttpProxy.java | 47 --
.../domain/TargetInstance.java | 49 --
.../googlecomputeengine/domain/TargetPool.java | 100 ----
.../googlecomputeengine/domain/UrlMap.java | 125 -----
.../domain/UrlMapValidateResult.java | 84 ----
.../googlecomputeengine/domain/Warning.java | 40 --
.../googlecomputeengine/domain/Zone.java | 97 ----
.../features/AddressApi.java | 138 -----
.../features/AggregatedListApi.java | 501 -------------------
.../features/BackendServiceApi.java | 197 --------
.../googlecomputeengine/features/DiskApi.java | 175 -------
.../features/DiskTypeApi.java | 101 ----
.../features/FirewallApi.java | 168 -------
.../features/ForwardingRuleApi.java | 158 ------
.../features/HttpHealthCheckApi.java | 180 -------
.../googlecomputeengine/features/ImageApi.java | 226 ---------
.../features/InstanceApi.java | 323 ------------
.../features/LicenseApi.java | 48 --
.../features/MachineTypeApi.java | 101 ----
.../features/NetworkApi.java | 145 ------
.../features/OperationApi.java | 219 --------
.../features/ProjectApi.java | 80 ---
.../googlecomputeengine/features/RegionApi.java | 100 ----
.../googlecomputeengine/features/RouteApi.java | 134 -----
.../features/SnapshotApi.java | 111 ----
.../features/TargetHttpProxyApi.java | 175 -------
.../features/TargetInstanceApi.java | 129 -----
.../features/TargetPoolApi.java | 250 ---------
.../googlecomputeengine/features/UrlMapApi.java | 216 --------
.../googlecomputeengine/features/ZoneApi.java | 100 ----
.../GoogleComputeEngineErrorHandler.java | 59 ---
.../internal/BaseArg0ToIteratorOfListPage.java | 23 -
.../BaseCallerArg0ToIteratorOfListPage.java | 23 -
.../internal/BaseToIteratorOfListPage.java | 23 -
.../options/AddressCreationOptions.java | 62 ---
.../options/BackendServiceOptions.java | 155 ------
.../options/DeprecateOptions.java | 113 -----
.../options/DiskCreationOptions.java | 94 ----
.../options/FirewallOptions.java | 182 -------
.../options/ForwardingRuleCreationOptions.java | 109 ----
.../options/HttpHealthCheckCreationOptions.java | 169 -------
.../options/ImageCreationOptions.java | 87 ----
.../options/ListOptions.java | 89 ----
.../options/NetworkCreationOptions.java | 85 ----
.../options/RouteOptions.java | 218 --------
.../options/TargetHttpProxyOptions.java | 67 ---
.../options/TargetPoolCreationOptions.java | 142 ------
.../options/UrlMapOptions.java | 145 ------
...GoogleComputeEngineProviderMetadataTest.java | 34 --
.../binders/DiskCreationBinderTest.java | 53 --
.../ForwardingRuleCreationBinderTest.java | 72 ---
.../HttpHealthCheckCreationBinderTest.java | 72 ---
.../TargetPoolAddInstanceBinderTest.java | 59 ---
.../GoogleComputeEngineServiceLiveTest.java | 149 ------
.../GoogleComputeEngineServiceMockTest.java | 270 ----------
...gleComputeEngineTemplateBuilderLiveTest.java | 79 ---
.../GoogleComputeEngineImageToImageTest.java | 106 ----
.../ImageNameToOperatingSystemTest.java | 52 --
.../functions/InstanceToNodeMetadataTest.java | 202 --------
.../OrphanedGroupsFromDeadNodesTest.java | 172 -------
.../compute/functions/ResourcesMockTest.java | 162 ------
.../UseApiToResolveProjectNameMockTest.java | 76 ---
.../features/AddressApiLiveTest.java | 60 ---
.../features/AddressApiMockTest.java | 100 ----
.../features/AggregatedListApiLiveTest.java | 168 -------
.../features/AggregatedListApiMockTest.java | 207 --------
.../features/BackendServiceApiLiveTest.java | 131 -----
.../features/BackendServiceApiMockTest.java | 152 ------
.../features/DiskApiLiveTest.java | 103 ----
.../features/DiskApiMockTest.java | 142 ------
.../features/DiskTypeApiLiveTest.java | 66 ---
.../features/DiskTypeApiMockTest.java | 63 ---
.../features/FirewallApiLiveTest.java | 124 -----
.../features/FirewallApiMockTest.java | 140 ------
.../features/ForwardingRuleApiLiveTest.java | 125 -----
.../features/ForwardingRuleApiMockTest.java | 114 -----
.../GlobalForwardingRuleApiLiveTest.java | 138 -----
.../GlobalForwardingRuleApiMockTest.java | 106 ----
.../features/HttpHealthCheckApiLiveTest.java | 120 -----
.../features/HttpHealthCheckApiMockTest.java | 121 -----
.../features/ImageApiLiveTest.java | 128 -----
.../features/ImageApiMockTest.java | 154 ------
.../features/InstanceApiLiveTest.java | 358 -------------
.../features/InstanceApiMockTest.java | 293 -----------
.../features/LicenseApiLiveTest.java | 47 --
.../features/LicenseApiMockTest.java | 46 --
.../features/MachineTypeApiLiveTest.java | 62 ---
.../features/MachineTypeApiMockTest.java | 63 ---
.../features/NetworkApiLiveTest.java | 73 ---
.../features/NetworkApiMockTest.java | 87 ----
.../features/OperationApiLiveTest.java | 98 ----
.../features/OperationApiMockTest.java | 166 ------
.../features/ProjectApiLiveTest.java | 82 ---
.../features/ProjectApiMockTest.java | 72 ---
.../features/RegionApiLiveTest.java | 62 ---
.../features/RegionApiMockTest.java | 63 ---
.../features/RouteApiLiveTest.java | 90 ----
.../features/RouteApiMockTest.java | 98 ----
.../features/SnapshotApiLiveTest.java | 85 ----
.../features/SnapshotApiMockTest.java | 79 ---
.../features/TargetHttpProxyApiLiveTest.java | 114 -----
.../features/TargetHttpProxyApiMockTest.java | 114 -----
.../features/TargetInstanceApiLiveTest.java | 77 ---
.../features/TargetInstanceApiMockTest.java | 101 ----
.../features/TargetPoolApiLiveTest.java | 274 ----------
.../features/TargetPoolApiMockTest.java | 178 -------
.../features/UrlMapApiLiveTest.java | 214 --------
.../features/UrlMapApiMockTest.java | 139 -----
.../features/ZoneApiLiveTest.java | 64 ---
.../features/ZoneApiMockTest.java | 63 ---
.../GoogleComputeEngineErrorHandlerTest.java | 92 ----
.../BaseGoogleComputeEngineApiLiveTest.java | 158 ------
.../BaseGoogleComputeEngineApiMockTest.java | 147 ------
.../BaseGoogleComputeEngineExpectTest.java | 122 -----
.../BaseGoogleComputeEngineParseTest.java | 41 --
.../internal/GoogleComputeEngineTestModule.java | 94 ----
.../ToIteratorOfListPageExpectTest.java | 184 -------
.../parse/ParseAddressListTest.java | 66 ---
.../parse/ParseAddressTest.java | 59 ---
.../parse/ParseBackendServiceListTest.java | 69 ---
.../parse/ParseBackendServiceTest.java | 74 ---
.../parse/ParseDiskListTest.java | 51 --
.../parse/ParseDiskTest.java | 62 ---
.../parse/ParseDiskTypeListTest.java | 60 ---
.../parse/ParseDiskTypeTest.java | 51 --
.../parse/ParseFirewallListTest.java | 66 ---
.../parse/ParseFirewallTest.java | 63 ---
.../parse/ParseForwardingRuleListTest.java | 51 --
.../parse/ParseForwardingRuleTest.java | 57 ---
.../ParseGlobalForwardingRuleListTest.java | 46 --
.../parse/ParseGlobalForwardingRuleTest.java | 51 --
.../parse/ParseGlobalOperationListTest.java | 51 --
.../parse/ParseGlobalOperationTest.java | 69 ---
.../parse/ParseHealthStatusTest.java | 58 ---
.../parse/ParseHttpHealthCheckListTest.java | 84 ----
.../parse/ParseHttpHealthCheckTest.java | 59 ---
.../parse/ParseImageListTest.java | 50 --
.../parse/ParseImageTest.java | 74 ---
.../parse/ParseInstanceListTest.java | 51 --
.../parse/ParseInstanceSerialOutputTest.java | 48 --
.../parse/ParseInstanceTest.java | 94 ----
.../parse/ParseLicenseTest.java | 46 --
.../parse/ParseMachineTypeListTest.java | 98 ----
.../parse/ParseMachineTypeTest.java | 63 ---
.../parse/ParseMetadataTest.java | 39 --
.../parse/ParseNetworkListTest.java | 51 --
.../parse/ParseNetworkTest.java | 54 --
.../parse/ParseOperationTest.java | 79 ---
.../parse/ParseProjectTest.java | 71 ---
.../parse/ParseQuotaTest.java | 39 --
.../parse/ParseRegionListTest.java | 74 ---
.../parse/ParseRegionOperationTest.java | 69 ---
.../parse/ParseRegionTest.java | 69 ---
.../parse/ParseRouteListTest.java | 70 ---
.../parse/ParseRouteTest.java | 67 ---
.../parse/ParseSnapshotListTest.java | 69 ---
.../parse/ParseSnapshotTest.java | 59 ---
.../parse/ParseTargetHttpProxyListTest.java | 60 ---
.../parse/ParseTargetHttpProxyTest.java | 51 --
.../parse/ParseTargetInstanceListTest.java | 62 ---
.../parse/ParseTargetInstanceTest.java | 53 --
.../parse/ParseTargetPoolListTest.java | 51 --
.../parse/ParseTargetPoolTest.java | 58 ---
.../parse/ParseUrlMapListTest.java | 63 ---
.../parse/ParseUrlMapTest.java | 81 ---
.../parse/ParseUrlMapValidateTest.java | 56 ---
.../parse/ParseZoneListTest.java | 72 ---
.../parse/ParseZoneOperationTest.java | 69 ---
.../parse/ParseZoneTest.java | 65 ---
.../parse/SimpleParsingTests.java | 82 ---
.../src/test/resources/address_get.json | 14 -
.../src/test/resources/address_insert.json | 1 -
.../src/test/resources/address_list.json | 32 --
.../test/resources/aggregated_address_list.json | 131 -----
.../aggregated_address_list_empty.json | 115 -----
.../test/resources/aggregated_disk_list.json | 118 -----
.../resources/aggregated_disk_list_empty.json | 115 -----
.../resources/aggregated_disktype_list.json | 127 -----
.../aggregated_disktype_list_empty.json | 115 -----
.../aggregated_forwarding_rule_list.json | 60 ---
.../aggregated_forwarding_rule_list_empty.json | 55 --
.../aggregated_global_operation_list.json | 99 ----
.../aggregated_global_operation_list_empty.json | 115 -----
.../resources/aggregated_instance_list.json | 174 -------
.../aggregated_instance_list_empty.json | 115 -----
.../resources/aggregated_machinetype_list.json | 58 ---
.../aggregated_target_instance_list.json | 128 -----
.../aggregated_target_instance_list_empty.json | 55 --
.../resources/aggregated_target_pool_list.json | 46 --
.../aggregated_target_pool_list_empty.json | 43 --
.../src/test/resources/backend_service_get.json | 24 -
.../backend_service_get_health_request.json | 1 -
.../test/resources/backend_service_insert.json | 9 -
.../test/resources/backend_service_list.json | 45 --
.../test/resources/disk_create_snapshot.json | 1 -
.../src/test/resources/disk_get.json | 11 -
.../resources/disk_get_with_source_image.json | 12 -
.../src/test/resources/disk_insert.json | 1 -
.../src/test/resources/disk_insert_ssd.json | 1 -
.../src/test/resources/disk_list.json | 18 -
.../src/test/resources/disktype.json | 11 -
.../src/test/resources/disktype_list.json | 27 -
.../test/resources/disktype_list_central1b.json | 17 -
.../src/test/resources/disktype_ssd.json | 11 -
.../src/test/resources/firewall_get.json | 30 --
.../src/test/resources/firewall_insert.json | 22 -
.../src/test/resources/firewall_insert_2.json | 28 --
.../src/test/resources/firewall_list.json | 58 ---
.../test/resources/firewall_list_compute.json | 36 --
.../src/test/resources/forwardingrule_get.json | 12 -
.../test/resources/forwardingrule_insert.json | 4 -
.../src/test/resources/forwardingrule_list.json | 19 -
.../resources/forwardingrule_set_target.json | 1 -
.../resources/global_forwarding_rule_get.json | 12 -
.../global_forwarding_rule_insert.json | 1 -
.../resources/global_forwarding_rule_list.json | 19 -
.../global_forwarding_rule_setTarget.json | 3 -
.../src/test/resources/global_operation.json | 16 -
.../test/resources/global_operation_list.json | 23 -
.../resources/health_status_get_health.json | 10 -
.../src/test/resources/httphealthcheck_get.json | 14 -
.../test/resources/httphealthcheck_insert.json | 1 -
.../test/resources/httphealthcheck_list.json | 39 --
.../test/resources/httphealthcheck_patch.json | 1 -
.../src/test/resources/image_deprecate.json | 7 -
.../src/test/resources/image_get.json | 25 -
.../resources/image_get_for_source_image.json | 25 -
.../src/test/resources/image_insert.json | 4 -
.../test/resources/image_insert_from_pd.json | 1 -
.../src/test/resources/image_list.json | 32 --
.../src/test/resources/image_list_centos.json | 183 -------
.../src/test/resources/image_list_debian.json | 400 ---------------
.../src/test/resources/image_list_empty.json | 6 -
.../resources/image_list_multiple_page_1.json | 55 --
.../resources/image_list_multiple_page_2.json | 47 --
.../test/resources/image_list_single_page.json | 71 ---
.../resources/instance_add_access_config.json | 11 -
.../test/resources/instance_attach_disk.json | 18 -
.../src/test/resources/instance_get.json | 74 ---
.../src/test/resources/instance_insert.json | 34 --
.../src/test/resources/instance_insert_2.json | 39 --
.../test/resources/instance_insert_full.json | 47 --
.../test/resources/instance_insert_simple.json | 30 --
.../src/test/resources/instance_insert_ssd.json | 40 --
.../src/test/resources/instance_list.json | 81 ---
.../instance_list_central1b_empty.json | 6 -
.../test/resources/instance_serial_port.json | 5 -
.../test/resources/instance_set_metadata.json | 1 -
.../src/test/resources/instance_set_tags.json | 4 -
.../src/test/resources/license_get.json | 6 -
.../src/test/resources/list_empty.json | 5 -
.../src/test/resources/logback.xml | 83 ---
.../src/test/resources/machinetype.json | 21 -
.../src/test/resources/machinetype_list.json | 54 --
.../src/test/resources/metadata.json | 1 -
.../src/test/resources/network_get.json | 10 -
.../src/test/resources/network_get_default.json | 10 -
.../src/test/resources/network_insert.json | 1 -
.../src/test/resources/network_list.json | 18 -
.../src/test/resources/operation.json | 40 --
.../src/test/resources/operation_error.json | 26 -
.../src/test/resources/operation_list.json | 24 -
.../src/test/resources/project.json | 73 ---
.../src/test/resources/quota.json | 5 -
.../src/test/resources/region_get.json | 60 ---
.../src/test/resources/region_list.json | 126 -----
.../src/test/resources/region_operation.json | 17 -
.../test/resources/region_operation_list.json | 24 -
.../src/test/resources/route_get.json | 28 --
.../src/test/resources/route_insert.json | 1 -
.../src/test/resources/route_list.json | 47 --
.../src/test/resources/snapshot_get.json | 13 -
.../src/test/resources/snapshot_list.json | 33 --
.../src/test/resources/tag_insert.json | 1 -
.../test/resources/target_http_proxy_get.json | 8 -
.../resources/target_http_proxy_insert.json | 4 -
.../test/resources/target_http_proxy_list.json | 24 -
.../target_http_proxy_set_url_map.json | 1 -
.../src/test/resources/target_instance_get.json | 11 -
.../test/resources/target_instance_insert.json | 6 -
.../test/resources/target_instance_list.json | 30 --
.../test/resources/targetpool_addinstance.json | 1 -
.../resources/targetpool_changehealthcheck.json | 1 -
.../src/test/resources/targetpool_get.json | 9 -
.../src/test/resources/targetpool_insert.json | 3 -
.../src/test/resources/targetpool_list.json | 17 -
.../test/resources/targetpool_setbackup.json | 1 -
google-compute-engine/src/test/resources/test | 27 -
.../src/test/resources/url_map_get.json | 39 --
.../src/test/resources/url_map_insert.json | 1 -
.../src/test/resources/url_map_list.json | 56 ---
.../src/test/resources/url_map_validate.json | 17 -
.../resources/url_map_validate_request.json | 1 -
.../src/test/resources/zone_get.json | 18 -
.../src/test/resources/zone_list.json | 43 --
.../src/test/resources/zone_list_short.json | 25 -
.../src/test/resources/zone_operation.json | 17 -
.../test/resources/zone_operation_error.json | 25 -
.../src/test/resources/zone_operation_list.json | 24 -
googlecloud/pom.xml | 62 ---
.../googlecloud/GoogleCredentialsFromJson.java | 63 ---
.../googlecloud/config/CurrentProject.java | 50 --
.../config/GoogleCloudProperties.java | 40 --
.../config/ListPageAdapterFactory.java | 109 ----
.../googlecloud/domain/ForwardingListPage.java | 51 --
.../jclouds/googlecloud/domain/ListPage.java | 28 --
.../googlecloud/internal/AdvancingIterator.java | 48 --
.../internal/BaseArg0ToIteratorOfListPage.java | 58 ---
.../BaseCallerArg0ToIteratorOfListPage.java | 58 ---
.../internal/BaseToIteratorOfListPage.java | 49 --
.../jclouds/googlecloud/internal/ListPages.java | 57 ---
.../googlecloud/internal/NullSafeCopies.java | 39 --
.../googlecloud/options/ListOptions.java | 30 --
.../googlecloud/internal/TestProperties.java | 108 ----
pom.xml | 2 -
377 files changed, 7 insertions(+), 28935 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9e4d772..4da3fc3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,5 @@
+If you are looking for the google-compute-engine provider, go to the main jclouds reposityy
+
Please review the [How to Contribute](https://cwiki.apache.org/confluence/display/JCLOUDS/Contribute) page for information on how to submit your patch and how the review process works.
Also make sure all the changes are aligned with the [Coding Standards](https://cwiki.apache.org/confluence/display/JCLOUDS/Writing+jclouds+Code) of the project.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 64ca8ef..79c2e80 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
jclouds Labs Google
======================
-Repository for developing [Google Cloud Platform](https://cloud.google.com/) providers and [APIs](https://cloud.google.com/storage/docs/json_api/v1/)
+Repository for developing experimental [Google Cloud Platform](https://cloud.google.com/) providers and [APIs](https://cloud.google.com/storage/docs/json_api/v1/)
+
+The Google Compute Engine provider has already been graduated to the main jclouds repo.
License
-------
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-cloud-storage/pom.xml
----------------------------------------------------------------------
diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml
index 203bb39..1b08640 100644
--- a/google-cloud-storage/pom.xml
+++ b/google-cloud-storage/pom.xml
@@ -49,13 +49,13 @@
<version>${jclouds.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.jclouds.labs</groupId>
+ <groupId>org.apache.jclouds.common</groupId>
<artifactId>googlecloud</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
- <groupId>org.apache.jclouds.labs</groupId>
+ <groupId>org.apache.jclouds.common</groupId>
<artifactId>googlecloud</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/README.md
----------------------------------------------------------------------
diff --git a/google-compute-engine/README.md b/google-compute-engine/README.md
deleted file mode 100644
index aa88a7c..0000000
--- a/google-compute-engine/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-jclouds Google Compute Engine Provider
-======
-
-
-Authenticating into the instances:
---------
-
-User:
-If no user is specified in the template options when launching instances, the default one will be used: "jclouds" for all instances, "core" for CoreOS images, and "Administrator" for Windows images.
-
-Credential:
-
-GCE uses exclusively ssh keys to login into instances.
-In order for an instance to be sshable a public key must be installed. Public keys are installed if they are present in the project or instance's metatada.
-
-For an instance to be ssable one of the following must happen:
-1 - the project's metadata has an adequately built "sshKeys" entry and a corresponding private key is provided in GoogleComputeEngineTemplateOptions when createNodesInGroup is called.
-2 - an instance of GoogleComputeEngineTemplateOptions with an adequate public and private key is provided.
-
-NOTE: if methods 2 is chosen the global project keys will not be installed in the instance.
-
-Please refer to Google's documentation on how to form valid project wide ssh keys metadata entries.
-
-FAQ:
---------
-
-* Q. What is the identity for GCE?
-
-A. the identity is the developer email which can be obtained from the admin GUI. Its usually something in the form: [PROJECT_ID](https://cloud.google.com/compute/docs/overview#projectids)@developer.gserviceaccount.com
-
-* Q. What is the credential for GCE
-
-A. the credential is a private key, in pem format. It can be extracted from the p12 keystore that is obtained when creating a "Service Account" (in the GUI: Google apis console > Api Access > Create another client ID > "Service Account"
-
-* Q. How to convert a p12 keystore into a pem format jclouds Google Compute Engine can handle:
-
-A.
-
-1. Convert the p12 file into pem format (it will ask for the keystore password, which is usually "notasecret"):
- openssl pkcs12 -in <my_keystore>.p12 -out <my_keystore>.pem -nodes
-
-2. Extract only the pk and remove passphrase
- openssl rsa -in <my_keystore>.pem -out <my_key>.pem
-
-The last file (<my_key>.pem) should contain the pk that needs to be passed to `ContextBuilder.credential()` for the provider `google-compute-engine`.
-
-
-Running the live tests:
---------
-
-1. Place the following in your ~/.m2/settings.xml in a profile enabled when live:
-```
- <test.google-compute-engine.identity>PROJECT_ID@developer.gserviceaccount.com</test.google-compute-engine.identity>
- <test.google-compute-engine.credential>-----BEGIN RSA PRIVATE KEY-----
-MIICXgIBAAKBgQRRbRqVDtJLN1MO/xJoKqZuphDeBh5jIKueW3aNIiWs1XFcct+h
--- this text is literally from your <my_key>.pem
-aH7xmpHSTbbXmQkuuv+z8EKijigprd/FoJpTX1f5/R+4wQ==
------END RSA PRIVATE KEY-----</test.google-compute-engine.credential>
- </properties>
-```
-Or, if using an existing OAuth Bearer Token for authentication.
-```
- <test.google-compute-engine.identity>PROJECT_ID@developer.gserviceaccount.com</test.google-compute-engine.identity>
- <test.google-compute-engine.credential>EXISTING_BEARER_TOKEN</test.google-compute-engine.credential>
- <test.jclouds.oauth.credential-type>bearerTokenCredentials</test.jclouds.oauth.credential-type>
- </properties>
-```
-
-2. mvn clean install -Plive
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/pom.xml
----------------------------------------------------------------------
diff --git a/google-compute-engine/pom.xml b/google-compute-engine/pom.xml
deleted file mode 100644
index 2cf38fb..0000000
--- a/google-compute-engine/pom.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jclouds-labs-google</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.provider -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>google-compute-engine</artifactId>
- <name>jclouds Google Compute Engine provider</name>
- <description>jclouds components to access GoogleCompute</description>
-
- <properties>
- <test.google-compute-engine.identity>client_email which usually looks like project_id@developer.gserviceaccount.com</test.google-compute-engine.identity>
- <test.google-compute-engine.credential>Private key (PEM encoded PKCS12 file or literal) associated with the client_email</test.google-compute-engine.credential>
- <!-- Add this property to use a different project, or avoid looking up the project for each test. -->
- <test.jclouds.googlecloud.project-name></test.jclouds.googlecloud.project-name>
- <test.jclouds.oauth.credential-type>p12PrivateKeyCredentials</test.jclouds.oauth.credential-type>
- <test.google-compute-engine.api-version>v1</test.google-compute-engine.api-version>
- <test.google-compute-engine.build-version/>
- <test.google-compute-engine.template>imageNameMatches=debian-7-wheezy-v[0-9]*,locationId=us-central1-a,minRam=2048</test.google-compute-engine.template>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>googlecloud</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>googlecloud</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.auto.service</groupId>
- <artifactId>auto-service</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.auto.value</groupId>
- <artifactId>auto-value</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${jclouds.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- <version>${jclouds.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-okhttp</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>mockwebserver</artifactId>
- <scope>test</scope>
- <exclusions>
- <!-- Already provided by jclouds-sshj -->
- <exclusion>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15on</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>default-test</id>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </execution>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <threadCount>1</threadCount>
- <systemPropertyVariables>
- <test.google-compute-engine.identity>${test.google-compute-engine.identity}</test.google-compute-engine.identity>
- <test.google-compute-engine.credential>${test.google-compute-engine.credential}</test.google-compute-engine.credential>
- <test.jclouds.googlecloud.project-name>${test.jclouds.googlecloud.project-name}</test.jclouds.googlecloud.project-name>
- <test.jclouds.oauth.credential-type>${test.jclouds.oauth.credential-type}</test.jclouds.oauth.credential-type>
- <test.google-compute-engine.api-version>${test.google-compute-engine.api-version}</test.google-compute-engine.api-version>
- <test.google-compute-engine.build-version>${test.google-compute-engine.build-version}</test.google-compute-engine.build-version>
- <test.google-compute-engine.template>${test.google-compute-engine.template}</test.google-compute-engine.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
deleted file mode 100644
index 21c0764..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine;
-
-import java.io.Closeable;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.jclouds.googlecloud.config.CurrentProject;
-import org.jclouds.googlecomputeengine.features.AddressApi;
-import org.jclouds.googlecomputeengine.features.AggregatedListApi;
-import org.jclouds.googlecomputeengine.features.BackendServiceApi;
-import org.jclouds.googlecomputeengine.features.DiskApi;
-import org.jclouds.googlecomputeengine.features.DiskTypeApi;
-import org.jclouds.googlecomputeengine.features.FirewallApi;
-import org.jclouds.googlecomputeengine.features.ForwardingRuleApi;
-import org.jclouds.googlecomputeengine.features.HttpHealthCheckApi;
-import org.jclouds.googlecomputeengine.features.ImageApi;
-import org.jclouds.googlecomputeengine.features.InstanceApi;
-import org.jclouds.googlecomputeengine.features.LicenseApi;
-import org.jclouds.googlecomputeengine.features.MachineTypeApi;
-import org.jclouds.googlecomputeengine.features.NetworkApi;
-import org.jclouds.googlecomputeengine.features.OperationApi;
-import org.jclouds.googlecomputeengine.features.ProjectApi;
-import org.jclouds.googlecomputeengine.features.RegionApi;
-import org.jclouds.googlecomputeengine.features.RouteApi;
-import org.jclouds.googlecomputeengine.features.SnapshotApi;
-import org.jclouds.googlecomputeengine.features.TargetInstanceApi;
-import org.jclouds.googlecomputeengine.features.TargetPoolApi;
-import org.jclouds.googlecomputeengine.features.TargetHttpProxyApi;
-import org.jclouds.googlecomputeengine.features.UrlMapApi;
-import org.jclouds.googlecomputeengine.features.ZoneApi;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.Endpoint;
-
-public interface GoogleComputeEngineApi extends Closeable {
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/regions/{region}")
- AddressApi addressesInRegion(@PathParam("region") String region);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- AggregatedListApi aggregatedList();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global/backendServices")
- BackendServiceApi backendServices();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}")
- DiskApi disksInZone(@PathParam("zone") String zone);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}")
- DiskTypeApi diskTypesInZone(@PathParam("zone") String zone);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global")
- FirewallApi firewalls();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/regions/{region}")
- ForwardingRuleApi forwardingRulesInRegion(@PathParam("region") String region);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global")
- ForwardingRuleApi globalForwardingRules();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global")
- HttpHealthCheckApi httpHeathChecks();
-
- @Delegate
- ImageApi images();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}")
- InstanceApi instancesInZone(@PathParam("zone") String zone);
-
- @Delegate
- @Path("/projects/{project}/global")
- LicenseApi licensesInProject(@PathParam("project") String project);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}")
- MachineTypeApi machineTypesInZone(@PathParam("zone") String zone);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global")
- NetworkApi networks();
-
- @Delegate
- OperationApi operations();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- ProjectApi project();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- RegionApi regions();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global")
- RouteApi routes();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global")
- SnapshotApi snapshots();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- TargetHttpProxyApi targetHttpProxies();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/zones/{zone}")
- TargetInstanceApi targetInstancesInZone(@PathParam("zone") String zone);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/regions/{region}")
- TargetPoolApi targetPoolsInRegion(@PathParam("region") String region);
-
- @Delegate
- @Endpoint(CurrentProject.class)
- ZoneApi zones();
-
- @Delegate
- @Endpoint(CurrentProject.class)
- @Path("/global/urlMaps")
- UrlMapApi urlMaps();
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
deleted file mode 100644
index c2e632a..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
+++ /dev/null
@@ -1,101 +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;
-
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.PROJECT_NAME;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.IMAGE_PROJECTS;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.OPERATION_COMPLETE_INTERVAL;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.OPERATION_COMPLETE_TIMEOUT;
-import static org.jclouds.oauth.v2.config.OAuthProperties.AUDIENCE;
-import static org.jclouds.oauth.v2.config.OAuthProperties.JWS_ALG;
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.googlecloud.config.CurrentProject;
-import org.jclouds.googlecomputeengine.compute.config.GoogleComputeEngineServiceContextModule;
-import org.jclouds.googlecomputeengine.config.GoogleComputeEngineHttpApiModule;
-import org.jclouds.googlecomputeengine.config.GoogleComputeEngineParserModule;
-import org.jclouds.oauth.v2.config.OAuthModule;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-public class GoogleComputeEngineApiMetadata extends BaseHttpApiMetadata<GoogleComputeEngineApi> {
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public GoogleComputeEngineApiMetadata() {
- this(new Builder());
- }
-
- protected GoogleComputeEngineApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.put("oauth.endpoint", "https://accounts.google.com/o/oauth2/token");
- properties.put(AUDIENCE, "https://accounts.google.com/o/oauth2/token");
- properties.put(JWS_ALG, "RS256");
- properties.put(PROPERTY_SESSION_INTERVAL, 3600);
- properties.put(OPERATION_COMPLETE_INTERVAL, 500);
- properties.put(OPERATION_COMPLETE_TIMEOUT, 600000);
- properties.put(TEMPLATE, "osFamily=DEBIAN,osVersionMatches=7\\..*,locationId=us-central1-a");
- properties.put(PROJECT_NAME, ""); // Defaulting to empty helps avoid temptation for optional inject!
- properties.put(IMAGE_PROJECTS, "centos-cloud,debian-cloud,rhel-cloud,suse-cloud,opensuse-cloud,gce-nvme,coreos-cloud,ubuntu-os-cloud,windows-cloud");
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<GoogleComputeEngineApi, Builder> {
-
- protected Builder() {
- id("google-compute-engine")
- .name("Google Compute Engine Api")
- .identityName(CurrentProject.ClientEmail.DESCRIPTION)
- .credentialName("PEM encoded P12 private key associated with client_email")
- .documentation(URI.create("https://developers.google.com/compute/docs"))
- .version("v1")
- .defaultEndpoint("https://www.googleapis.com/compute/v1")
- .defaultProperties(GoogleComputeEngineApiMetadata.defaultProperties())
- .view(typeToken(ComputeServiceContext.class))
- .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
- .add(GoogleComputeEngineHttpApiModule.class)
- .add(GoogleComputeEngineParserModule.class)
- .add(OAuthModule.class)
- .add(GoogleComputeEngineServiceContextModule.class)
- .build());
- }
-
- @Override
- public GoogleComputeEngineApiMetadata build() {
- return new GoogleComputeEngineApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineFallbacks.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineFallbacks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineFallbacks.java
deleted file mode 100644
index 105da4d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineFallbacks.java
+++ /dev/null
@@ -1,36 +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;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Predicates.in;
-import static com.google.common.base.Throwables.propagate;
-import static com.google.common.primitives.Ints.asList;
-import static org.jclouds.http.HttpUtils.returnValueOnCodeOrNull;
-
-import org.jclouds.Fallback;
-
-public final class GoogleComputeEngineFallbacks {
- public static class NullOn400or404 implements Fallback<Object> {
- @Override public Object createOrPropagate(Throwable t) throws Exception {
- Boolean returnVal = returnValueOnCodeOrNull(checkNotNull(t, "throwable"), false, in(asList(400, 404)));
- if (returnVal != null)
- return null;
- throw propagate(t);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadata.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadata.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadata.java
deleted file mode 100644
index 43c8855..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadata.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadata;
-
-import com.google.auto.service.AutoService;
-
-/** Note: This does not set iso3166Codes as Google intentionally does not document them. */
-@AutoService(ProviderMetadata.class)
-public final class GoogleComputeEngineProviderMetadata extends BaseProviderMetadata {
-
- public static Builder builder() {
- return new Builder();
- }
-
- @Override
- public Builder toBuilder() {
- return builder().fromProviderMetadata(this);
- }
-
- public GoogleComputeEngineProviderMetadata() {
- super(builder());
- }
-
- public GoogleComputeEngineProviderMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- return new Properties(); // currently all are set in the api metadata class.
- }
-
- public static final class Builder extends BaseProviderMetadata.Builder {
-
- private Builder() {
- id("google-compute-engine") //
- .name("Google Compute Engine") //
- .apiMetadata(new GoogleComputeEngineApiMetadata()) //
- .homepage(URI.create("https://cloud.google.com/compute")) //
- .console(URI.create("https://console.developers.google.com/project")) //
- .defaultProperties(GoogleComputeEngineProviderMetadata.defaultProperties());
- }
-
- @Override public GoogleComputeEngineProviderMetadata build() {
- return new GoogleComputeEngineProviderMetadata(this);
- }
-
- @Override public Builder fromProviderMetadata(ProviderMetadata in) {
- super.fromProviderMetadata(in);
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinder.java
deleted file mode 100644
index b91671d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinder.java
+++ /dev/null
@@ -1,58 +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.binders;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.Map;
-
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.MapBinder;
-
-import com.google.gson.stream.JsonWriter;
-
-public final class DiskCreationBinder implements MapBinder {
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- DiskCreationOptions options = (DiskCreationOptions) postParams.get("options");
- Writer out = new StringWriter();
- JsonWriter json = new JsonWriter(out);
- json.setSerializeNulls(false);
- try {
- json.beginObject();
- json.name("name").value(postParams.get("name").toString());
- json.name("sizeGb").value(options.sizeGb());
- json.name("type").value(options.type() != null ? options.type().toString() : null);
- json.name("sourceSnapshot")
- .value(options.sourceSnapshot() != null ? options.sourceSnapshot().toString() : null);
- json.name("description").value(options.description());
- json.endObject();
- json.close();
- } catch (IOException e) {
- throw new AssertionError(e); // should be impossible as we are writing a string!
- }
- request.setPayload(out.toString());
- request.getPayload().getContentMetadata().setContentType("application/json");
- return request;
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) {
- throw new UnsupportedOperationException();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/FirewallBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/FirewallBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/FirewallBinder.java
deleted file mode 100644
index 43f7c48..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/FirewallBinder.java
+++ /dev/null
@@ -1,47 +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.binders;
-
-import java.net.URI;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.MapBinder;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-public class FirewallBinder implements MapBinder {
-
- private final BindToJsonPayload jsonBinder;
-
- @Inject FirewallBinder(BindToJsonPayload jsonBinder){
- this.jsonBinder = jsonBinder;
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- FirewallOptions options = (FirewallOptions) postParams.get("options");
- options.name(postParams.get("name").toString());
- options.network((URI) postParams.get("network"));
- return bindToRequest(request, options);
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) {
- return jsonBinder.bindToRequest(request, input);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinder.java
deleted file mode 100644
index df0e6fc..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinder.java
+++ /dev/null
@@ -1,73 +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.binders;
-
-import java.net.URI;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.json.Json;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-
-public class ForwardingRuleCreationBinder extends BindToJsonPayload {
-
- @Inject ForwardingRuleCreationBinder(Json jsonBinder) {
- super(jsonBinder);
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- ForwardingRuleCreationOptions options = (ForwardingRuleCreationOptions) postParams.get("options");
- String name = postParams.get("name").toString();
- ForwardingRuleCreationBinderHelper forwardingRuleCreationBinderHelper = new ForwardingRuleCreationBinderHelper(name, options);
- return super.bindToRequest(request, forwardingRuleCreationBinderHelper);
- }
-
- private class ForwardingRuleCreationBinderHelper{
-
- /**
- * Values used to bind ForwardingRuleOptions to json request.
- * Note: Two break convention of starting with lower case letters due to
- * attributes on GCE starting with upper case letters.
- */
- @SuppressWarnings("unused")
- private String name;
- @SuppressWarnings("unused")
- private String description;
- @SuppressWarnings("unused")
- private String IPAddress;
- @SuppressWarnings("unused")
- private ForwardingRule.IPProtocol IPProtocol;
- @SuppressWarnings("unused")
- private String portRange;
- @SuppressWarnings("unused")
- private URI target;
-
- private ForwardingRuleCreationBinderHelper(String name, ForwardingRuleCreationOptions forwardingRuleCreationOptions){
- this.name = name;
- this.description = forwardingRuleCreationOptions.description();
- this.IPAddress = forwardingRuleCreationOptions.ipAddress();
- this.IPProtocol = forwardingRuleCreationOptions.ipProtocol();
- this.portRange = forwardingRuleCreationOptions.portRange();
- this.target = forwardingRuleCreationOptions.target();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinder.java
deleted file mode 100644
index 636cced..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinder.java
+++ /dev/null
@@ -1,78 +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.binders;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.json.Json;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-
-public class HttpHealthCheckCreationBinder extends BindToJsonPayload {
-
- @Inject HttpHealthCheckCreationBinder(Json jsonBinder) {
- super(jsonBinder);
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- HttpHealthCheckCreationOptions options = (HttpHealthCheckCreationOptions) postParams.get("options");
- String name = postParams.get("name").toString();
- HttpHealthCheckBinderHelper helper = new HttpHealthCheckBinderHelper(name, options);
- return super.bindToRequest(request, helper);
- }
-
- private class HttpHealthCheckBinderHelper{
-
- /**
- * Values used to bind HttpHealthCheckCreationOptions to json request.
- */
- @SuppressWarnings("unused")
- private String name;
- @SuppressWarnings("unused")
- private String host;
- @SuppressWarnings("unused")
- private String requestPath;
- @SuppressWarnings("unused")
- private Integer port;
- @SuppressWarnings("unused")
- private Integer checkIntervalSec;
- @SuppressWarnings("unused")
- private Integer timeoutSec;
- @SuppressWarnings("unused")
- private Integer unhealthyThreshold;
- @SuppressWarnings("unused")
- private Integer healthyThreshold;
- @SuppressWarnings("unused")
- private String description;
-
- private HttpHealthCheckBinderHelper(String name, HttpHealthCheckCreationOptions httpHealthCheckCreationOptions){
- this.name = name;
- this.host = httpHealthCheckCreationOptions.host();
- this.requestPath = httpHealthCheckCreationOptions.requestPath();
- this.port = httpHealthCheckCreationOptions.port();
- this.checkIntervalSec = httpHealthCheckCreationOptions.checkIntervalSec();
- this.timeoutSec = httpHealthCheckCreationOptions.timeoutSec();
- this.unhealthyThreshold = httpHealthCheckCreationOptions.unhealthyThreshold();
- this.healthyThreshold = httpHealthCheckCreationOptions.healthyThreshold();
- this.description = httpHealthCheckCreationOptions.description();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/RouteBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/RouteBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/RouteBinder.java
deleted file mode 100644
index 6b454bf..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/RouteBinder.java
+++ /dev/null
@@ -1,47 +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.binders;
-
-import java.net.URI;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.options.RouteOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.MapBinder;
-import org.jclouds.rest.binders.BindToJsonPayload;
-
-public class RouteBinder implements MapBinder {
-
- private final BindToJsonPayload jsonBinder;
-
- @Inject RouteBinder(BindToJsonPayload jsonBinder){
- this.jsonBinder = jsonBinder;
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- RouteOptions options = (RouteOptions) postParams.get("options");
- options.name(postParams.get("name").toString());
- options.network((URI) postParams.get("network"));
- return bindToRequest(request, options);
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) {
- return jsonBinder.bindToRequest(request, input);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeHealthChecksBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeHealthChecksBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeHealthChecksBinder.java
deleted file mode 100644
index 6c0e0e2..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeHealthChecksBinder.java
+++ /dev/null
@@ -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.binders;
-
-import javax.inject.Inject;
-
-/**
- * Binder used for adding and deleting healthChecks from a target pool.
- */
-public final class TargetPoolChangeHealthChecksBinder extends TargetPoolMapofListofMapGenericBinder {
- @Inject TargetPoolChangeHealthChecksBinder() {
- super("healthChecks", "healthCheck");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeInstancesBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeInstancesBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeInstancesBinder.java
deleted file mode 100644
index 4572505..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolChangeInstancesBinder.java
+++ /dev/null
@@ -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.binders;
-
-import javax.inject.Inject;
-
-/**
- * Binder used for adding and deleting instances from a target pool.
- */
-public final class TargetPoolChangeInstancesBinder extends TargetPoolMapofListofMapGenericBinder {
- @Inject TargetPoolChangeInstancesBinder() {
- super("instances", "instance");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolMapofListofMapGenericBinder.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolMapofListofMapGenericBinder.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolMapofListofMapGenericBinder.java
deleted file mode 100644
index fa611f1..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/binders/TargetPoolMapofListofMapGenericBinder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.binders;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.MapBinder;
-
-import com.google.gson.stream.JsonWriter;
-
-class TargetPoolMapofListofMapGenericBinder implements MapBinder {
- private final String outterString;
- private final String innerString;
-
- TargetPoolMapofListofMapGenericBinder(String outterString, String innerString) {
- this.outterString = outterString;
- this.innerString = innerString;
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- Writer out = new StringWriter();
- JsonWriter json = new JsonWriter(out);
- try {
- json.beginObject();
- json.name(outterString);
- json.beginArray();
- for (URI uri : (List<URI>) postParams.get(outterString)) {
- json.beginObject();
- json.name(innerString).value(uri.toString());
- json.endObject();
- }
- json.endArray();
- json.endObject();
- json.close();
- } catch (IOException e) {
- throw new AssertionError(e); // should be impossible as we are writing a string!
- }
- request.setPayload(out.toString());
- request.getPayload().getContentMetadata().setContentType("application/json");
- return request;
- }
-
- @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) {
- throw new UnsupportedOperationException();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java
deleted file mode 100644
index 74c7c57..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineService.java
+++ /dev/null
@@ -1,183 +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.compute;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Sets.newHashSet;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_SUSPENDED;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
-import static org.jclouds.compute.predicates.NodePredicates.all;
-import static org.jclouds.googlecloud.internal.ListPages.concat;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Provider;
-
-import org.jclouds.Constants;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.compute.callables.RunScriptOnNode;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.jclouds.compute.extensions.ImageExtension;
-import org.jclouds.compute.extensions.SecurityGroupExtension;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.compute.internal.BaseComputeService;
-import org.jclouds.compute.internal.PersistNodeCredentials;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet;
-import org.jclouds.compute.strategy.DestroyNodeStrategy;
-import org.jclouds.compute.strategy.GetImageStrategy;
-import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
-import org.jclouds.compute.strategy.InitializeRunScriptOnNodeOrPlaceInBadMap;
-import org.jclouds.compute.strategy.ListNodesStrategy;
-import org.jclouds.compute.strategy.RebootNodeStrategy;
-import org.jclouds.compute.strategy.ResumeNodeStrategy;
-import org.jclouds.compute.strategy.SuspendNodeStrategy;
-import org.jclouds.domain.Credentials;
-import org.jclouds.domain.Location;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.features.FirewallApi;
-import org.jclouds.scriptbuilder.functions.InitAdminAccess;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.util.concurrent.Atomics;
-import com.google.common.util.concurrent.ListeningExecutorService;
-
-public final class GoogleComputeEngineService extends BaseComputeService {
-
- private final Function<Set<? extends NodeMetadata>, Set<String>> findOrphanedGroups;
- private final GroupNamingConvention.Factory namingConvention;
- private final GoogleComputeEngineApi api;
- private final Predicate<AtomicReference<Operation>> operationDone;
-
- @Inject GoogleComputeEngineService(ComputeServiceContext context,
- Map<String, Credentials> credentialStore,
- @Memoized Supplier<Set<? extends Image>> images,
- @Memoized Supplier<Set<? extends Hardware>> hardwareProfiles,
- @Memoized Supplier<Set<? extends Location>> locations,
- ListNodesStrategy listNodesStrategy,
- GetImageStrategy getImageStrategy,
- GetNodeMetadataStrategy getNodeMetadataStrategy,
- CreateNodesInGroupThenAddToSet runNodesAndAddToSetStrategy,
- RebootNodeStrategy rebootNodeStrategy,
- DestroyNodeStrategy destroyNodeStrategy,
- ResumeNodeStrategy resumeNodeStrategy,
- SuspendNodeStrategy suspendNodeStrategy,
- Provider<TemplateBuilder> templateBuilderProvider,
- @Named("DEFAULT") Provider<TemplateOptions> templateOptionsProvider,
- @Named(TIMEOUT_NODE_RUNNING) Predicate<AtomicReference<NodeMetadata>>
- nodeRunning,
- @Named(TIMEOUT_NODE_TERMINATED) Predicate<AtomicReference<NodeMetadata>>
- nodeTerminated,
- @Named(TIMEOUT_NODE_SUSPENDED)
- Predicate<AtomicReference<NodeMetadata>> nodeSuspended,
- InitializeRunScriptOnNodeOrPlaceInBadMap.Factory initScriptRunnerFactory,
- InitAdminAccess initAdminAccess,
- RunScriptOnNode.Factory runScriptOnNodeFactory,
- PersistNodeCredentials persistNodeCredentials,
- ComputeServiceConstants.Timeouts timeouts,
- @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor,
- Optional<ImageExtension> imageExtension,
- Optional<SecurityGroupExtension> securityGroupExtension,
- Function<Set<? extends NodeMetadata>, Set<String>> findOrphanedGroups,
- GroupNamingConvention.Factory namingConvention,
- GoogleComputeEngineApi api,
- Predicate<AtomicReference<Operation>> operationDone) {
- super(context, credentialStore, images, hardwareProfiles, locations, listNodesStrategy, getImageStrategy,
- getNodeMetadataStrategy, runNodesAndAddToSetStrategy, rebootNodeStrategy, destroyNodeStrategy,
- resumeNodeStrategy, suspendNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning,
- nodeTerminated, nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory,
- persistNodeCredentials, timeouts, userExecutor, imageExtension, securityGroupExtension);
- this.findOrphanedGroups = findOrphanedGroups;
- this.namingConvention = namingConvention;
- this.api = api;
- this.operationDone = operationDone;
- }
-
- @Override
- public void destroyNode(String id) {
- // GCE does not return TERMINATED nodes, so in practice no node will never reach the TERMINATED
- // state, and the deleted nodes will never be returned.
- // In order to be able to clean up the resources associated to the deleted nodes, we have to retrieve
- // the details of the nodes before deleting them.
- NodeMetadata node = getNodeMetadata(id);
- super.destroyNode(id);
- cleanUpIncidentalResourcesOfDeadNodes(ImmutableSet.of(node));
- }
-
- @Override
- public Set<? extends NodeMetadata> destroyNodesMatching(Predicate<NodeMetadata> filter) {
- // GCE does not return TERMINATED nodes, so in practice no node will never reach the TERMINATED
- // state, and the deleted nodes will never be returned.
- // In order to be able to clean up the resources associated to the deleted nodes, we have to retrieve
- // the details of the nodes before deleting them.
- Set<? extends NodeMetadata> nodes = newHashSet(filter(listNodesDetailsMatching(all()), filter));
- super.destroyNodesMatching(filter); // This returns an empty list (a list of null elements) in GCE, as the api does not return deleted nodes
- cleanUpIncidentalResourcesOfDeadNodes(nodes);
- return nodes;
- }
-
-
-
- @Override
- protected synchronized void cleanUpIncidentalResourcesOfDeadNodes(Set<? extends NodeMetadata> deadNodes) {
- Set<String> orphanedGroups = findOrphanedGroups.apply(deadNodes);
- for (String orphanedGroup : orphanedGroups) {
- cleanUpFirewallsForGroup(orphanedGroup);
- }
- }
-
- private void cleanUpFirewallsForGroup(final String groupName) {
- GroupNamingConvention namingScheme = namingConvention.create();
- FirewallApi firewallApi = api.firewalls();
-
- for (Firewall firewall : concat(firewallApi.list())) {
- String foundGroup = namingScheme.groupInUniqueNameOrNull(firewall.name());
- if ((foundGroup != null) && foundGroup.equals(groupName)){
- AtomicReference<Operation> operation = Atomics.newReference(firewallApi.delete(firewall.name()));
- operationDone.apply(operation);
-
- if (operation.get().httpErrorStatusCode() != null) {
- logger.warn("delete orphaned firewall %s failed. Http Error Code: %d HttpError: %s",
- operation.get().targetId(), operation.get().httpErrorStatusCode(),
- operation.get().httpErrorMessage());
- }
- }
- }
- }
-
- @Override
- public GoogleComputeEngineTemplateOptions templateOptions() {
- return GoogleComputeEngineTemplateOptions.class.cast(super.templateOptions());
- }
-}
[02/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/region_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/region_get.json b/google-compute-engine/src/test/resources/region_get.json
deleted file mode 100644
index ce33d23..0000000
--- a/google-compute-engine/src/test/resources/region_get.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "kind": "compute#region",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "id": "12912210600542709766",
- "creationTimestamp": "2013-07-08T14:40:37.939-07:00",
- "name": "us-central1",
- "description": "us-central1",
- "status": "UP",
- "zones": [
- "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-b"
- ],
- "quotas": [
- {
- "metric": "INSTANCES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "CPUS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "EPHEMERAL_ADDRESSES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS_TOTAL_GB",
- "usage": 0,
- "limit": 100
- },
- {
- "metric": "SNAPSHOTS",
- "usage": 0,
- "limit": 1000
- },
- {
- "metric": "NETWORKS",
- "usage": 1,
- "limit": 5
- },
- {
- "metric": "FIREWALLS",
- "usage": 2,
- "limit": 100
- },
- {
- "metric": "IMAGES",
- "usage": 0,
- "limit": 100
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/region_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/region_list.json b/google-compute-engine/src/test/resources/region_list.json
deleted file mode 100644
index c9edc33..0000000
--- a/google-compute-engine/src/test/resources/region_list.json
+++ /dev/null
@@ -1,126 +0,0 @@
-{
- "kind": "compute#regionList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions",
- "id": "projects/party/regions",
- "items": [
- {
- "kind": "compute#region",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "id": "12912210600542709766",
- "creationTimestamp": "2013-07-08T14:40:37.939-07:00",
- "name": "us-central1",
- "description": "us-central1",
- "status": "UP",
- "zones": [
- "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-b"
- ],
- "quotas": [
- {
- "metric": "INSTANCES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "CPUS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "EPHEMERAL_ADDRESSES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS_TOTAL_GB",
- "usage": 0,
- "limit": 100
- },
- {
- "metric": "SNAPSHOTS",
- "usage": 0,
- "limit": 1000
- },
- {
- "metric": "NETWORKS",
- "usage": 1,
- "limit": 5
- },
- {
- "metric": "FIREWALLS",
- "usage": 2,
- "limit": 100
- },
- {
- "metric": "IMAGES",
- "usage": 0,
- "limit": 100
- }
- ]
- },
- {
- "kind": "compute#region",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central2",
- "id": "6396763663251190992",
- "creationTimestamp": "2013-07-08T14:40:37.939-07:00",
- "name": "us-central2",
- "description": "us-central2",
- "status": "UP",
- "zones": [
- "https://www.googleapis.com/compute/v1/projects/party/zones/us-central2-a"
- ],
- "quotas": [
- {
- "metric": "INSTANCES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "CPUS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "EPHEMERAL_ADDRESSES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS_TOTAL_GB",
- "usage": 0,
- "limit": 100
- },
- {
- "metric": "SNAPSHOTS",
- "usage": 0,
- "limit": 1000
- },
- {
- "metric": "NETWORKS",
- "usage": 1,
- "limit": 5
- },
- {
- "metric": "FIREWALLS",
- "usage": 2,
- "limit": 100
- },
- {
- "metric": "IMAGES",
- "usage": 0,
- "limit": 100
- }
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/region_operation.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/region_operation.json b/google-compute-engine/src/test/resources/region_operation.json
deleted file mode 100644
index 9f8e6fa..0000000
--- a/google-compute-engine/src/test/resources/region_operation.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-address",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/region_operation_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/region_operation_list.json b/google-compute-engine/src/test/resources/region_operation_list.json
deleted file mode 100644
index b63ba6c..0000000
--- a/google-compute-engine/src/test/resources/region_operation_list.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "kind": "compute#operationList",
- "id": "projects/party/regions/us-central1/operations",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/operations",
- "items": [
- {
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-address",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/route_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/route_get.json b/google-compute-engine/src/test/resources/route_get.json
deleted file mode 100644
index ee649fd..0000000
--- a/google-compute-engine/src/test/resources/route_get.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "kind": "compute#route",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/routes/default-route-c99ebfbed0e1f375",
- "id": "7241926205630356071",
- "creationTimestamp": "2013-07-08T14:40:38.502-07:00",
- "name": "default-route-c99ebfbed0e1f375",
- "description": "Default route to the virtual network.",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "destRange": "10.240.0.0/16",
- "priority": 1000,
- "nextHopNetwork": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "tags": [
- "fooTag",
- "barTag"
- ],
- "warnings": [
- {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "This is an example warning",
- "data": [
- {
- "key": "scope",
- "value": "There are no results for scope 'zones/asia-east1-b' on this page."
- }
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/route_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/route_insert.json b/google-compute-engine/src/test/resources/route_insert.json
deleted file mode 100644
index cba1a92..0000000
--- a/google-compute-engine/src/test/resources/route_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"default-route-c99ebfbed0e1f375","description":"Default route to the virtual network.","network":"https://www.googleapis.com/compute/v1/projects/party/global/networks/default","destRange":"10.240.0.0/16","priority":1000,"nextHopNetwork":"https://www.googleapis.com/compute/v1/projects/party/global/networks/default","tags":["fooTag","barTag"]}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/route_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/route_list.json b/google-compute-engine/src/test/resources/route_list.json
deleted file mode 100644
index 2dca138..0000000
--- a/google-compute-engine/src/test/resources/route_list.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "kind": "compute#routeList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/routes",
- "id": "projects/party/global/routes",
- "items": [
- {
- "kind": "compute#route",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/routes/default-route-c99ebfbed0e1f375",
- "id": "7241926205630356071",
- "creationTimestamp": "2013-07-08T14:40:38.502-07:00",
- "name": "default-route-c99ebfbed0e1f375",
- "description": "Default route to the virtual network.",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "destRange": "10.240.0.0/16",
- "priority": 1000,
- "nextHopNetwork": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "tags": [
- "fooTag",
- "barTag"
- ],
- "warnings": [
- {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "This is an example warning",
- "data": [
- {
- "key": "scope",
- "value": "There are no results for scope 'zones/asia-east1-b' on this page."
- }
- ]
- }
- ]
- },
- {
- "kind": "compute#route",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/routes/default-route-fc92a41ecb5a8d17",
- "id": "507025480040058551",
- "creationTimestamp": "2013-07-08T14:40:38.502-07:00",
- "name": "default-route-fc92a41ecb5a8d17",
- "description": "Default route to the Internet.",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "destRange": "0.0.0.0/0",
- "priority": 1000,
- "nextHopGateway": "https://www.googleapis.com/compute/v1/projects/party/global/gateways/default-internet-gateway"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/snapshot_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/snapshot_get.json b/google-compute-engine/src/test/resources/snapshot_get.json
deleted file mode 100644
index 592a765..0000000
--- a/google-compute-engine/src/test/resources/snapshot_get.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-
- "kind": "compute#snapshot",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/snapshots/test-snap",
- "id": "9734455566806191190",
- "creationTimestamp": "2013-07-26T12:54:23.173-07:00",
- "status": "READY",
- "diskSizeGb": "10",
- "sourceDisk": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/testimage1",
- "name": "test-snap",
- "description": "",
- "sourceDiskId": "8243603669926824540"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/snapshot_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/snapshot_list.json b/google-compute-engine/src/test/resources/snapshot_list.json
deleted file mode 100644
index de6a296..0000000
--- a/google-compute-engine/src/test/resources/snapshot_list.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "kind": "compute#snapshotList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/snapshots",
- "id": "projects/party/global/snapshots",
- "items": [
- {
-
- "kind": "compute#snapshot",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/snapshots/test-snap",
- "id": "9734455566806191190",
- "creationTimestamp": "2013-07-26T12:54:23.173-07:00",
- "status": "READY",
- "diskSizeGb": "10",
- "sourceDisk": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/testimage1",
- "name": "test-snap",
- "description": "",
- "sourceDiskId": "8243603669926824540"
- },
- {
-
- "kind": "compute#snapshot",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/snapshots/test-snap2",
- "id": "13895715048576107883",
- "creationTimestamp": "2013-07-26T12:57:01.927-07:00",
- "status": "READY",
- "diskSizeGb": "10",
- "sourceDisk": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/testimage1",
- "name": "test-snap2",
- "description": "",
- "sourceDiskId": "8243603669926824540"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/tag_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/tag_insert.json b/google-compute-engine/src/test/resources/tag_insert.json
deleted file mode 100644
index 61ade71..0000000
--- a/google-compute-engine/src/test/resources/tag_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"items":["aTag"],"fingerprint":"abcd"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_http_proxy_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_http_proxy_get.json b/google-compute-engine/src/test/resources/target_http_proxy_get.json
deleted file mode 100644
index 45a67f7..0000000
--- a/google-compute-engine/src/test/resources/target_http_proxy_get.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "kind": "compute#targetHttpProxy",
- "id": "13050421646334304115",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test",
- "name": "jclouds-test",
- "urlMap": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_http_proxy_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_http_proxy_insert.json b/google-compute-engine/src/test/resources/target_http_proxy_insert.json
deleted file mode 100644
index 991055a..0000000
--- a/google-compute-engine/src/test/resources/target_http_proxy_insert.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "jclouds-test",
- "urlMap": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_http_proxy_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_http_proxy_list.json b/google-compute-engine/src/test/resources/target_http_proxy_list.json
deleted file mode 100644
index 4c66239..0000000
--- a/google-compute-engine/src/test/resources/target_http_proxy_list.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "kind": "compute#targetHttpProxyList",
- "id": "projects/myproject/targetHttpProxies",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies",
- "items": [
- {
- "kind": "compute#targetHttpProxy",
- "id": "13050421646334304115",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test",
- "name": "jclouds-test",
- "urlMap": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test"
- },
- {
- "kind": "compute#targetHttpProxy",
- "id": "13050421646334304116",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test-2",
- "name": "jclouds-test-2",
- "description": "Simple proxy",
- "urlMap": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test-2"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_http_proxy_set_url_map.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_http_proxy_set_url_map.json b/google-compute-engine/src/test/resources/target_http_proxy_set_url_map.json
deleted file mode 100644
index 12ac072..0000000
--- a/google-compute-engine/src/test/resources/target_http_proxy_set_url_map.json
+++ /dev/null
@@ -1 +0,0 @@
-{"urlMap":"https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_instance_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_instance_get.json b/google-compute-engine/src/test/resources/target_instance_get.json
deleted file mode 100644
index b90f527..0000000
--- a/google-compute-engine/src/test/resources/target_instance_get.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "kind": "compute#targetInstance",
- "id": "13050421646334304115",
- "creationTimestamp": "2014-07-18T09:47:30.826-07:00",
- "name": "target-instance-1",
- "description": "A pretty cool target instance",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "natPolicy": "NO_NAT",
- "instance": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-0",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/targetInstances/target-instance-1"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_instance_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_instance_insert.json b/google-compute-engine/src/test/resources/target_instance_insert.json
deleted file mode 100644
index 9e76ef8..0000000
--- a/google-compute-engine/src/test/resources/target_instance_insert.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "test-target-instance",
- "description": "This is a test",
- "natPolicy": "NO_NAT",
- "instance": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/instance-1"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/target_instance_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/target_instance_list.json b/google-compute-engine/src/test/resources/target_instance_list.json
deleted file mode 100644
index 7e5e2c2..0000000
--- a/google-compute-engine/src/test/resources/target_instance_list.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "kind": "compute#targetInstanceList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/targetInstances",
- "id": "projects/studied-point-720/zones/us-central1-a/targetInstances",
- "items": [
- {
-
- "kind": "compute#targetInstance",
- "id": "13050421646334304115",
- "creationTimestamp": "2014-07-18T09:47:30.826-07:00",
- "name": "target-instance-1",
- "description": "A pretty cool target instance",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "natPolicy": "NO_NAT",
- "instance": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-0",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/targetInstances/target-instance-1"
- },
- {
-
- "kind": "compute#targetInstance",
- "id": "7362436693678237415",
- "creationTimestamp": "2014-11-20T17:35:17.268-08:00",
- "name": "target-instance-2",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "natPolicy": "NO_NAT",
- "instance": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-3",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/targetInstances/target-instance-2"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/targetpool_addinstance.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/targetpool_addinstance.json b/google-compute-engine/src/test/resources/targetpool_addinstance.json
deleted file mode 100644
index 1b67388..0000000
--- a/google-compute-engine/src/test/resources/targetpool_addinstance.json
+++ /dev/null
@@ -1 +0,0 @@
-{"instances":[{"instance":"https://www.googleapis.com/compute/v1/projects/party/zones/europe-west1-a/instances/test"}]}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/targetpool_changehealthcheck.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/targetpool_changehealthcheck.json b/google-compute-engine/src/test/resources/targetpool_changehealthcheck.json
deleted file mode 100644
index 9bc0d1d..0000000
--- a/google-compute-engine/src/test/resources/targetpool_changehealthcheck.json
+++ /dev/null
@@ -1 +0,0 @@
-{"healthChecks":[{"healthCheck":"https://www.googleapis.com/compute/v1/projects/party/global/httpHealthChecks/health-check-1"}]}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/targetpool_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/targetpool_get.json b/google-compute-engine/src/test/resources/targetpool_get.json
deleted file mode 100644
index e85de7a..0000000
--- a/google-compute-engine/src/test/resources/targetpool_get.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "kind": "compute#targetPool",
- "id": "5199309593612841404",
- "creationTimestamp": "2014-01-07T05:25:27.783-08:00",
- "name": "test-targetpool",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "sessionAffinity": "NONE",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/targetPools/test-targetpool"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/targetpool_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/targetpool_insert.json b/google-compute-engine/src/test/resources/targetpool_insert.json
deleted file mode 100644
index cdbc2f7..0000000
--- a/google-compute-engine/src/test/resources/targetpool_insert.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "name": "test"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/targetpool_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/targetpool_list.json b/google-compute-engine/src/test/resources/targetpool_list.json
deleted file mode 100644
index bf6eef6..0000000
--- a/google-compute-engine/src/test/resources/targetpool_list.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "kind": "compute#targetPoolList",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/party/regions/us-central1/targetPools",
- "id": "projects/party/regions/us-central1/targetPools",
- "items": [
- {
-
- "kind": "compute#targetPool",
- "id": "5199309593612841404",
- "creationTimestamp": "2014-01-07T05:25:27.783-08:00",
- "name": "test-targetpool",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "sessionAffinity": "NONE",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/targetPools/test-targetpool"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/targetpool_setbackup.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/targetpool_setbackup.json b/google-compute-engine/src/test/resources/targetpool_setbackup.json
deleted file mode 100644
index 3679c0d..0000000
--- a/google-compute-engine/src/test/resources/targetpool_setbackup.json
+++ /dev/null
@@ -1 +0,0 @@
-{"target":"https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/targetPools/tpool"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/test
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/test b/google-compute-engine/src/test/resources/test
deleted file mode 100644
index 5de8a47..0000000
--- a/google-compute-engine/src/test/resources/test
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEogIBAAKCAQEAnJvA40x4OK+9nVYTS0N916VMjC6/qYe/IuDUdy6hdW1wz9IO
-MTS3CPxlE0KuoNO1/M7O7yFso6IragTxUkNqJ2mUOqV0Bf0CEkUIKzeYRGfpx+QM
-PorHbLQXjjFinWKwibZuv6lqtvqwcsrjW7bpWsz9x+0qqKM0o0UhjUMhTRqZoYxo
-E2zUH7WA8JRatE/bQkjv/nWBfI+/WzSDhJn7AjIql0Nd4Q+bxohIJEZu8yDw1H6T
-pd7mw83m6UYBk4eZH79r3d2euuQMUKIunyLbw7vNJJ8qYTJQuNYIiJuWKnzzjxuJ
-UfumhdOqfjSobznhAjTLUbA/btZCiQ/TasV4cQIDAQABAoIBAEeOn1b8ZN455qDS
-aKR2JTT4cX6ICckznnEYW9xNMTcPl4FN0HBJTuzLLn/bcyFHOxtVf5YiJpqqCb46
-ne1hokp54mHdoaLu1Rh19GKS139CH77XA4U8Mh0IOM8e35lcM5/o/LeUeI89Aoyh
-CbupWvzDN543TsuZLv7/InKCXt/0dXhAQpq3UiBT63EITQbyom5fSPnMzqM3F8jD
-E9ZqkX4JsnTPC7FQDIpPCaKjG9YCZqoljz+1ssli3mN66V/JKefcCiVoubalmmT2
-dpvmRtFaKvhAmkWYakYybYg8aDi3YygAHSU1bzxlY4TNiQgPdnTTDAPyeqqVrE1D
-Chi+18UCgYEAzlk7c+tFwxZ3ryycOe0loFudUNE5rviHhPgbOHoSTooXh0Hq1Vrb
-2ic+4FbRpoPHLpcLM9LX+arezUdeFBZ8qunjUG6MbUhAeAm/3cfMk+nZg3Skpg8+
-C1D3hxGX4qdhURHvc2QUH7VIUWbucvPgtL8pt1z5Su/EE1Cb2XVsvu8CgYEAwkqZ
-4vTZxI0XqJo6BfUnKGJEDC8xeWr10ELPdXLTCuNDpLSYNedQAxZi9XzvbnbWZ/MF
-Z7IWkzzyAjsX0gpI56cxxtas/chxUboBlUo6ZW8QcPDcU2sKJi318wzElqqvRMNM
-InfLf8nuPC9hyhe49/lFBBSZJeIo396DuqnTPp8CgYBO4NVVLm5wcLo3gDoH+psT
-fXHZXuFJ/T7wmVbuc9tjom30CkKWZDD+Z1olr4pcuKr/KEXj/YkJq0OX/Nv9mcr2
-GooGSPvtGl1qhW+Oe728HPxEv+XghJsXAFBelV8WCR2uO8jotyzqIgYO9+XWk1sm
-PJzZtvSkrJqrN3kb20NCiQKBgDDVP0hj8jgMnl2qJdtJesYTrLbDRdQWpiHqKOqE
-Kbca1+2V1ov1z453GfhJpoRFKi6GTl15zWLEdq9I2vvXyesvgrtPSbufnZvE/JDh
-TzwfZip832O4C5z9AExOcTrNO7A0xfYD1goQXuiRoCqDO+JXrJkR9EwpQ8zAyKsp
-9AZRAoGAGq3TYpmlI5oucEURHKsHOrIBirHFD+RaXMynxzgwkRnt6Z5Mg10I7Ddr
-LiGK8/IrF8bg1F7weLVmj93zjvhQTh5yvb1jwVdFGXM2rbR7/P7F6n2f7xM4+lmv
-Tq7E9Sv8UVuraAwJihlKCuBtpZM1t2JhcuNjXAZngj7R9j5HIZg=
------END RSA PRIVATE KEY-----
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/url_map_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/url_map_get.json b/google-compute-engine/src/test/resources/url_map_get.json
deleted file mode 100644
index 96ff1bc..0000000
--- a/google-compute-engine/src/test/resources/url_map_get.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "kind": "compute#urlMap",
- "id": "13741966667737398119",
- "creationTimestamp": "2014-07-23T12:39:50.022-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test",
- "name": "jclouds-test",
- "description": "Sample url map",
- "hostRules": [
- {
- "hosts": [
- "jclouds-test"
- ],
- "pathMatcher": "path"
- }
- ],
- "pathMatchers": [
- {
- "name": "path",
- "defaultService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "pathRules": [
- {
- "service": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "paths": [
- "/"
- ]
- }
- ]
- }
- ],
- "tests": [
- {
- "host": "jclouds-test",
- "path": "/test/path",
- "service": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test"
- }
- ],
- "defaultService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "fingerprint": "EDmhvJucpz4="
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/url_map_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/url_map_insert.json b/google-compute-engine/src/test/resources/url_map_insert.json
deleted file mode 100644
index 69cad5b..0000000
--- a/google-compute-engine/src/test/resources/url_map_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"jclouds-test","description":"Sample url map","hostRules":[{"hosts":["jclouds-test"],"pathMatcher":"path"}],"pathMatchers":[{"name":"path","defaultService":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test","pathRules":[{"service":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test","paths":["/"]}]}],"tests":[{"host":"jclouds-test","path":"/test/path","service":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test"}],"defaultService":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/url_map_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/url_map_list.json b/google-compute-engine/src/test/resources/url_map_list.json
deleted file mode 100644
index 9042bce..0000000
--- a/google-compute-engine/src/test/resources/url_map_list.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "kind": "compute#urlMapList",
- "id": "projects/myproject/global/urlMaps",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps",
- "items": [
- {
- "kind": "compute#urlMap",
- "id": "13741966667737398119",
- "creationTimestamp": "2014-07-23T12:39:50.022-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test",
- "name": "jclouds-test",
- "description": "Sample url map",
- "hostRules": [
- {
- "hosts": [
- "jclouds-test"
- ],
- "pathMatcher": "path"
- }
- ],
- "pathMatchers": [
- {
- "name": "path",
- "defaultService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "pathRules": [
- {
- "service": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "paths": [
- "/"
- ]
- }
- ]
- }
- ],
- "tests": [
- {
- "host": "jclouds-test",
- "path": "/test/path",
- "service": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test"
- }
- ],
- "defaultService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "fingerprint": "EDmhvJucpz4="
- },
- {
- "kind": "compute#urlMap",
- "id": "13741966667737398120",
- "creationTimestamp": "2014-07-23T12:39:50.022-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/urlMaps/jclouds-test-2",
- "name": "jclouds-test-2",
- "description": "Basic url map",
- "defaultService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "fingerprint": "EDqhvJucpz4="
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/url_map_validate.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/url_map_validate.json b/google-compute-engine/src/test/resources/url_map_validate.json
deleted file mode 100644
index 083b44e..0000000
--- a/google-compute-engine/src/test/resources/url_map_validate.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "result": {
- "loadSucceeded": false,
- "loadErrors": [
- "jclouds-test"
- ],
- "testPassed": false,
- "testFailures": [
- {
- "host": "jclouds-test",
- "path": "/test/path",
- "expectedService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "actualService": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test-2"
- }
- ]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/url_map_validate_request.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/url_map_validate_request.json b/google-compute-engine/src/test/resources/url_map_validate_request.json
deleted file mode 100644
index be963fa..0000000
--- a/google-compute-engine/src/test/resources/url_map_validate_request.json
+++ /dev/null
@@ -1 +0,0 @@
-{"resource":{"name":"jclouds-test","description":"Sample url map","hostRules":[{"hosts":["jclouds-test"],"pathMatcher":"path"}],"pathMatchers":[{"name":"path","defaultService":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test","pathRules":[{"service":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test","paths":["/"]}]}],"tests":[{"host":"jclouds-test","path":"/test/path","service":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test"}],"defaultService":"https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test"}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/zone_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/zone_get.json b/google-compute-engine/src/test/resources/zone_get.json
deleted file mode 100644
index 4ad9133..0000000
--- a/google-compute-engine/src/test/resources/zone_get.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "kind": "compute#zone",
- "id": "13020128040171887099",
- "creationTimestamp": "2012-10-19T16:42:54.131",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "name": "us-central1-a",
- "description": "us-central1-a",
- "region": "us-central1",
- "status": "DOWN",
- "maintenanceWindows": [
- {
- "name": "2012-11-10-planned-outage",
- "description": "maintenance zone",
- "beginTime": "2012-11-10T20:00:00.000",
- "endTime": "2012-12-02T20:00:00.000"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/zone_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/zone_list.json b/google-compute-engine/src/test/resources/zone_list.json
deleted file mode 100644
index c32c44b..0000000
--- a/google-compute-engine/src/test/resources/zone_list.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "kind": "compute#zoneList",
- "id": "projects/party/zones",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones",
- "items": [
- {
- "kind": "compute#zone",
- "id": "13020128040171887099",
- "creationTimestamp": "2012-10-19T16:42:54.131",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "name": "us-central1-a",
- "description": "us-central1-a",
- "status": "DOWN",
- "region": "us-central1",
- "maintenanceWindows": [
- {
- "name": "2012-11-10-planned-outage",
- "description": "maintenance zone",
- "beginTime": "2012-11-10T20:00:00.000",
- "endTime": "2012-12-02T20:00:00.000"
- }
- ]
- },
- {
- "kind": "compute#zone",
- "id": "13024414164050619686",
- "creationTimestamp": "2012-10-24T20:13:19.271",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-b",
- "name": "us-central1-b",
- "description": "us-central1-b",
- "status": "UP",
- "region": "us-central1",
- "maintenanceWindows": [
- {
- "name": "2013-02-17-planned-outage",
- "description": "maintenance zone",
- "beginTime": "2013-02-17T08:00:00.000",
- "endTime": "2013-03-03T08:00:00.000"
- }
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/zone_list_short.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/zone_list_short.json b/google-compute-engine/src/test/resources/zone_list_short.json
deleted file mode 100644
index c13ed95..0000000
--- a/google-compute-engine/src/test/resources/zone_list_short.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "kind": "compute#zoneList",
- "id": "projects/party/zones",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones",
- "items": [
- {
- "kind": "compute#zone",
- "id": "13020128040171887099",
- "creationTimestamp": "2012-10-19T16:42:54.131",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "name": "us-central1-a",
- "description": "us-central1-a",
- "status": "DOWN",
- "region": "us-central1",
- "maintenanceWindows": [
- {
- "name": "2012-11-10-planned-outage",
- "description": "maintenance zone",
- "beginTime": "2012-11-10T20:00:00.000",
- "endTime": "2012-12-02T20:00:00.000"
- }
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/zone_operation.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/zone_operation.json b/google-compute-engine/src/test/resources/zone_operation.json
deleted file mode 100644
index 4297784..0000000
--- a/google-compute-engine/src/test/resources/zone_operation.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-1",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/zone_operation_error.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/zone_operation_error.json b/google-compute-engine/src/test/resources/zone_operation_error.json
deleted file mode 100644
index e37bede..0000000
--- a/google-compute-engine/src/test/resources/zone_operation_error.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-1",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "httpErrorStatusCode": 400,
- "httpErrorMessage": "BAD REQUEST",
- "error": {
- "errors": [
- {
- "code": "RESOURCE_ALREADY_EXISTS",
- "message": "The resource 'projects/party/zones/us-central1-a/instances/test-1' already exists"
- }
- ]
- },
- "operationType": "insert",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/zone_operation_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/zone_operation_list.json b/google-compute-engine/src/test/resources/zone_operation_list.json
deleted file mode 100644
index 8658e5a..0000000
--- a/google-compute-engine/src/test/resources/zone_operation_list.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "kind": "compute#operationList",
- "id": "projects/party/zones/us-central1-a/operations",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations",
- "items": [
- {
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-1",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/pom.xml
----------------------------------------------------------------------
diff --git a/googlecloud/pom.xml b/googlecloud/pom.xml
deleted file mode 100644
index df6a7c7..0000000
--- a/googlecloud/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jclouds-labs-google</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.provider -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>googlecloud</artifactId>
- <name>jclouds Google Cloud Core</name>
- <description>jclouds components common to Google Cloud products</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>oauth</artifactId>
- <version>${jclouds.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>oauth</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.auto.value</groupId>
- <artifactId>auto-value</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/GoogleCredentialsFromJson.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/GoogleCredentialsFromJson.java b/googlecloud/src/main/java/org/jclouds/googlecloud/GoogleCredentialsFromJson.java
deleted file mode 100644
index 5100e1c..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/GoogleCredentialsFromJson.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.domain.Credentials;
-
-import com.google.common.base.Supplier;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-
-/*
- * Provides an easy way to pass in credentials using the json-key format.
- * Just provide the path to the .json file and this extracts and sets identity
- * and credentials from the json.
- */
-public class GoogleCredentialsFromJson implements Supplier<Credentials>{
-
- private final String jsonKeyString;
-
- public GoogleCredentialsFromJson(String jsonString){
- checkNotNull(jsonString, "Google Credentials jsonString cannot be null");
- jsonKeyString = jsonString;
- }
-
- /**
- * Function for parsing JSON Key String from file downloaded from GCP developers console.
- *
- * @param jsonString - a String in JSON format containing service account credentials
- * as provided from the Google Developers Console
- * @return Credentials object with Credentials.identity and Credentials.credential correctly set.
- */
- private static Credentials parseJsonKeyString(String jsonString) {
- // Parse JsonFile to extract Service Account and PrivateKey.
- final JsonObject json = new JsonParser().parse(jsonString).getAsJsonObject();
- String client_email = json.get("client_email").toString().replace("\"", "");
- // When reading the file it reads in \n in as
- String private_key = json.get("private_key").toString().replace("\"", "").replace("\\n", "\n");
-
- return new Credentials(client_email, // identity
- private_key); // credentials
- }
-
- @Override
- public Credentials get() {
- return parseJsonKeyString(jsonKeyString);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/config/CurrentProject.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/config/CurrentProject.java b/googlecloud/src/main/java/org/jclouds/googlecloud/config/CurrentProject.java
deleted file mode 100644
index d60b2d0..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/config/CurrentProject.java
+++ /dev/null
@@ -1,50 +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.googlecloud.config;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.inject.Qualifier;
-
-/** Associated bindings with the current <a href="https://cloud.google.com/compute/docs/projects">project</a>. */
-@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})
-@Qualifier
-public @interface CurrentProject {
-
- /** Utilities related to the email associated with the service account of a project. */
- public static final class ClientEmail {
- public static final String DESCRIPTION = "" //
- + "client_email which usually looks like project_id@developer.gserviceaccount.com or " //
- + "project_id-extended_uid@developer.gserviceaccount.com";
- private static final Pattern PROJECT_NUMBER_PATTERN = Pattern.compile("^([0-9]+)[@-].*");
-
- /** Parses the project number from the client email or throws an {@linkplain IllegalArgumentException}. */
- public static String toProjectNumber(String email) {
- Matcher matcher = PROJECT_NUMBER_PATTERN.matcher(email);
- checkArgument(matcher.find(), "Client email %s is malformed. Should be %s", email, DESCRIPTION);
- return matcher.group(1);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/config/GoogleCloudProperties.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/config/GoogleCloudProperties.java b/googlecloud/src/main/java/org/jclouds/googlecloud/config/GoogleCloudProperties.java
deleted file mode 100644
index baa6f8a..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/config/GoogleCloudProperties.java
+++ /dev/null
@@ -1,40 +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.googlecloud.config;
-
-import org.jclouds.oauth.v2.config.OAuthProperties;
-
-/** Configuration properties keys used in {@link org.jclouds.ContextBuilder#overrides(java.util.Properties)}. */
-public final class GoogleCloudProperties {
-
- /**
- * How requests are authorized using OAuth. Defaults to {@link org.jclouds.oauth.v2.config.CredentialType#P12_PRIVATE_KEY_CREDENTIALS}.
- *
- * @see org.jclouds.oauth.v2.config.CredentialType
- */
- public static final String CREDENTIAL_TYPE = OAuthProperties.CREDENTIAL_TYPE;
-
- /**
- * Set this property to specify the <a href="https://cloud.google.com/compute/docs/projects">project name</a> this
- * context applies to.
- * <p/> This is an alternative to looking up the project name at runtime.
- */
- public static final String PROJECT_NAME = "jclouds.googlecloud.project-name";
-
- private GoogleCloudProperties() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/config/ListPageAdapterFactory.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/config/ListPageAdapterFactory.java b/googlecloud/src/main/java/org/jclouds/googlecloud/config/ListPageAdapterFactory.java
deleted file mode 100644
index 5f8618f..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/config/ListPageAdapterFactory.java
+++ /dev/null
@@ -1,109 +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.googlecloud.config;
-
-import java.io.IOException;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-
-import com.google.common.collect.ImmutableList;
-import com.google.gson.Gson;
-import com.google.gson.TypeAdapter;
-import com.google.gson.TypeAdapterFactory;
-import com.google.gson.reflect.TypeToken;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonToken;
-import com.google.gson.stream.JsonWriter;
-
-public final class ListPageAdapterFactory implements TypeAdapterFactory {
- static final class ListPageAdapter extends TypeAdapter<ListPage<?>> {
- private final TypeAdapter<?> itemAdapter;
-
- ListPageAdapter(TypeAdapter<?> itemAdapter) {
- this.itemAdapter = itemAdapter;
- nullSafe();
- }
-
- public void write(JsonWriter out, ListPage<?> value) throws IOException {
- throw new UnsupportedOperationException("We only read ListPages!");
- }
-
- public ListPage<?> read(JsonReader in) throws IOException {
- ImmutableList.Builder<Object> items = ImmutableList.builder();
- String nextPageToken = null;
- in.beginObject();
- while (in.hasNext()) {
- String name = in.nextName();
- if (name.equals("items")) {
- if (in.peek() == JsonToken.BEGIN_ARRAY) {
- readItems(in, items);
- } else { // aggregated
- readAggregate(in, items);
- }
- } else if (name.equals("nextPageToken")) {
- nextPageToken = in.nextString();
- } else {
- in.skipValue();
- }
- }
- in.endObject();
- return ForwardingListPage.create(items.build(), nextPageToken);
- }
-
- private void readItems(JsonReader in, ImmutableList.Builder<Object> items) throws IOException {
- in.beginArray();
- while (in.hasNext()) {
- Object item = itemAdapter.read(in);
- if (item != null) {
- items.add(item);
- }
- }
- in.endArray();
- }
-
- private void readAggregate(JsonReader in, ImmutableList.Builder<Object> items) throws IOException {
- in.beginObject(); // enter zone name -> type -> items map
- while (in.hasNext()) {
- String scope = in.nextName(); // skip zone name
- in.beginObject(); // enter zone map
- while (in.hasNext()) {
- String resourceTypeOrWarning = in.nextName();
- if (!resourceTypeOrWarning.equals("warning")) {
- readItems(in, items);
- } else {
- in.skipValue();
- }
- }
- in.endObject(); // end zone map
- }
- in.endObject(); // end item wrapper
- }
- }
-
- @SuppressWarnings("unchecked") public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> ownerType) {
- Type type = ownerType.getType();
- if (ownerType.getRawType() != ListPage.class || !(type instanceof ParameterizedType)) {
- return null;
- }
- Type elementType = ((ParameterizedType) type).getActualTypeArguments()[0];
- TypeAdapter<?> itemAdapter = gson.getAdapter(TypeToken.get(elementType));
- return (TypeAdapter<T>) new ListPageAdapter(itemAdapter);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ForwardingListPage.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ForwardingListPage.java b/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ForwardingListPage.java
deleted file mode 100644
index f2aaa10..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ForwardingListPage.java
+++ /dev/null
@@ -1,51 +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.googlecloud.domain;
-
-import java.beans.ConstructorProperties;
-import java.util.List;
-
-import org.jclouds.googlecloud.internal.NullSafeCopies;
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ForwardingList;
-
-/** An immutable list that includes a token, if there is another page available. */
-public final class ForwardingListPage<T> extends ForwardingList<T> implements ListPage<T> {
-
- private final List<T> items;
- private final String nextPageToken;
-
- @ConstructorProperties({ "items", "nextPageToken" }) ForwardingListPage(List<T> items, String nextPageToken) {
- this.items = NullSafeCopies.copyOf(items);
- this.nextPageToken = nextPageToken;
- }
-
- public static <T> ListPage<T> create(List<T> items, String nextPageToken) {
- return new ForwardingListPage<T>(items, nextPageToken);
- }
-
- @Override @Nullable public String nextPageToken() {
- return nextPageToken;
- }
-
- @Override protected List<T> delegate() {
- return items;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ListPage.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ListPage.java b/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ListPage.java
deleted file mode 100644
index dc6c5aa..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/domain/ListPage.java
+++ /dev/null
@@ -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.googlecloud.domain;
-
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-
-/** An immutable list that includes a token, if there is another page available. */
-public interface ListPage<T> extends List<T> {
- /** Indicates more data is available. */
- @Nullable String nextPageToken();
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/internal/AdvancingIterator.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/AdvancingIterator.java b/googlecloud/src/main/java/org/jclouds/googlecloud/internal/AdvancingIterator.java
deleted file mode 100644
index 0010804..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/AdvancingIterator.java
+++ /dev/null
@@ -1,48 +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.googlecloud.internal;
-
-import org.jclouds.googlecloud.domain.ListPage;
-
-import com.google.common.base.Function;
-import com.google.common.collect.AbstractIterator;
-
-final class AdvancingIterator<T> extends AbstractIterator<ListPage<T>> {
-
- private final Function<String, ListPage<T>> tokenToNext;
- private ListPage<T> current;
- private boolean unread = true;
-
- AdvancingIterator(ListPage<T> initial, Function<String, ListPage<T>> tokenToNext) {
- this.current = initial;
- this.tokenToNext = tokenToNext;
- }
-
- @Override protected ListPage<T> computeNext() {
- if (unread) {
- try {
- return current;
- } finally {
- unread = false;
- }
- } else if (current.nextPageToken() != null) {
- return current = tokenToNext.apply(current.nextPageToken());
- } else {
- return endOfData();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseArg0ToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseArg0ToIteratorOfListPage.java b/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseArg0ToIteratorOfListPage.java
deleted file mode 100644
index 3aaa517..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseArg0ToIteratorOfListPage.java
+++ /dev/null
@@ -1,58 +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.googlecloud.internal;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecloud.options.ListOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.InvocationContext;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.base.Function;
-
-public abstract class BaseArg0ToIteratorOfListPage<T, O extends ListOptions, I extends BaseArg0ToIteratorOfListPage<T, O, I>>
- implements Function<ListPage<T>, Iterator<ListPage<T>>>, InvocationContext<I> {
-
- private GeneratedHttpRequest request;
-
- @Override public Iterator<ListPage<T>> apply(ListPage<T> input) {
- if (input.nextPageToken() == null) {
- return ListPages.singletonOrEmptyIterator(input);
- }
-
- String arg0 = (String) request.getInvocation().getArgs().get(0);
- O options = ListPages.listOptions(request.getInvocation().getArgs());
-
- return new AdvancingIterator<T>(input, fetchNextPage(arg0, options));
- }
-
- /**
- * This is used when you need to close over the first argument of this api.
- *
- * <p/> For example, {@code arg0} will become "myzone", which you can use to ensure the next page goes to the
- * same zone: <pre>{@code api.operations().listInZone("myzone")}</pre>
- */
- protected abstract Function<String, ListPage<T>> fetchNextPage(String arg0, O options);
-
- @SuppressWarnings("unchecked")
- @Override public I setContext(HttpRequest request) {
- this.request = GeneratedHttpRequest.class.cast(request);
- return (I) this;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseCallerArg0ToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseCallerArg0ToIteratorOfListPage.java b/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseCallerArg0ToIteratorOfListPage.java
deleted file mode 100644
index f1fef2d..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseCallerArg0ToIteratorOfListPage.java
+++ /dev/null
@@ -1,58 +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.googlecloud.internal;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecloud.options.ListOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.InvocationContext;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.base.Function;
-
-public abstract class BaseCallerArg0ToIteratorOfListPage<T, O extends ListOptions, I extends BaseCallerArg0ToIteratorOfListPage<T, O, I>>
- implements Function<ListPage<T>, Iterator<ListPage<T>>>, InvocationContext<I> {
-
- private GeneratedHttpRequest request;
-
- @Override public Iterator<ListPage<T>> apply(ListPage<T> input) {
- if (input.nextPageToken() == null) {
- return ListPages.singletonOrEmptyIterator(input);
- }
-
- String arg0 = (String) request.getCaller().get().getArgs().get(0);
- O options = ListPages.listOptions(request.getInvocation().getArgs());
-
- return new AdvancingIterator<T>(input, fetchNextPage(arg0, options));
- }
-
- /**
- * This is used when you need to close over the argument that created the api.
- *
- * <p/> For example, {@code callerArg0} will become "myzone", which you can use to ensure the next page goes to the
- * same zone: <pre>{@code api.instancesInZone("myzone").list()}</pre>
- */
- protected abstract Function<String, ListPage<T>> fetchNextPage(String callerArg0, O options);
-
- @SuppressWarnings("unchecked")
- @Override public I setContext(HttpRequest request) {
- this.request = GeneratedHttpRequest.class.cast(request);
- return (I) this;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseToIteratorOfListPage.java b/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseToIteratorOfListPage.java
deleted file mode 100644
index 364a183..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/BaseToIteratorOfListPage.java
+++ /dev/null
@@ -1,49 +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.googlecloud.internal;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecloud.options.ListOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.InvocationContext;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.base.Function;
-
-public abstract class BaseToIteratorOfListPage<T, O extends ListOptions, I extends BaseToIteratorOfListPage<T, O, I>>
- implements Function<ListPage<T>, Iterator<ListPage<T>>>, InvocationContext<I> {
-
- private GeneratedHttpRequest request;
-
- @Override public Iterator<ListPage<T>> apply(ListPage<T> input) {
- if (input.nextPageToken() == null) {
- return ListPages.singletonOrEmptyIterator(input);
- }
- return new AdvancingIterator<T>(input,
- fetchNextPage(ListPages.<O>listOptions(request.getInvocation().getArgs())));
- }
-
- protected abstract Function<String, ListPage<T>> fetchNextPage(O options);
-
- @SuppressWarnings("unchecked")
- @Override public I setContext(HttpRequest request) {
- this.request = GeneratedHttpRequest.class.cast(request);
- return (I) this;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/internal/ListPages.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/ListPages.java b/googlecloud/src/main/java/org/jclouds/googlecloud/internal/ListPages.java
deleted file mode 100644
index b874ca0..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/ListPages.java
+++ /dev/null
@@ -1,57 +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.googlecloud.internal;
-
-import static com.google.common.base.Predicates.instanceOf;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecloud.options.ListOptions;
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.AbstractIterator;
-import com.google.common.collect.Iterators;
-
-public final class ListPages {
-
- public static <T> Iterable<T> concat(final Iterator<ListPage<T>> input) {
- return new Iterable<T>() {
- @Override public Iterator<T> iterator() {
- return Iterators.concat(new AbstractIterator<Iterator<T>>() {
- @Override protected Iterator<T> computeNext() {
- return input.hasNext() ? input.next().iterator() : endOfData();
- }
- });
- }
- };
- }
-
- /** Value of {@code <O>} is a final class in the cloud provider. Rather than playing with reflection, we trust it. */
- @Nullable static <O extends ListOptions> O listOptions(List<Object> args) {
- return (O) tryFind(args, instanceOf(ListOptions.class)).orNull();
- }
-
- static <T> Iterator<ListPage<T>> singletonOrEmptyIterator(ListPage<T> input) {
- return input.isEmpty() ? Iterators.<ListPage<T>>emptyIterator() : Iterators.singletonIterator(input);
- }
-
- private ListPages() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/internal/NullSafeCopies.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/NullSafeCopies.java b/googlecloud/src/main/java/org/jclouds/googlecloud/internal/NullSafeCopies.java
deleted file mode 100644
index c1a0692..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/internal/NullSafeCopies.java
+++ /dev/null
@@ -1,39 +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.googlecloud.internal;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-public final class NullSafeCopies {
-
- public static <K, V> Map<K, V> copyOf(@Nullable Map<K, V> map) {
- return map != null ? ImmutableMap.copyOf(map) : ImmutableMap.<K, V>of();
- }
-
- public static <E> List<E> copyOf(@Nullable List<E> list) {
- return list != null ? ImmutableList.copyOf(list) : ImmutableList.<E>of();
- }
-
- private NullSafeCopies() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/googlecloud/src/main/java/org/jclouds/googlecloud/options/ListOptions.java
----------------------------------------------------------------------
diff --git a/googlecloud/src/main/java/org/jclouds/googlecloud/options/ListOptions.java b/googlecloud/src/main/java/org/jclouds/googlecloud/options/ListOptions.java
deleted file mode 100644
index a7ec97d..0000000
--- a/googlecloud/src/main/java/org/jclouds/googlecloud/options/ListOptions.java
+++ /dev/null
@@ -1,30 +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.googlecloud.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/** Base controls for listing resources in google cloud products. */
-public abstract class ListOptions extends BaseHttpRequestOptions {
- /** Sets Maximum count of results to be returned. Maximum value is product-specific. */
- public ListOptions maxResults(Integer maxResults) {
- this.queryParameters.put("maxResults", checkNotNull(maxResults, "maxResults").toString());
- return this;
- }
-}
[06/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/ToIteratorOfListPageExpectTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/ToIteratorOfListPageExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/ToIteratorOfListPageExpectTest.java
deleted file mode 100644
index 1bad3b3..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/ToIteratorOfListPageExpectTest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.internal;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.config.GoogleComputeEngineParserModule;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.features.AddressApi;
-import org.jclouds.googlecomputeengine.features.ImageApi;
-import org.jclouds.googlecomputeengine.features.InstanceApi;
-import org.jclouds.googlecomputeengine.parse.ParseAddressTest;
-import org.jclouds.googlecomputeengine.parse.ParseImageTest;
-import org.jclouds.googlecomputeengine.parse.ParseInstanceTest;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.json.Json;
-import org.jclouds.json.config.GsonModule;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.inject.Guice;
-
-@Test(groups = "unit", testName = "ToIteratorOfListPageTest")
-public class ToIteratorOfListPageExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> {
-
- private final Json json = Guice.createInjector(new GsonModule(), new GoogleComputeEngineParserModule())
- .getInstance(Json.class);
-
- public void globalScope() {
- HttpRequest list = HttpRequest
- .builder()
- .method("GET")
- .endpoint(BASE_URL + "/party/global/images")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Bearer " + TOKEN).build();
-
- HttpResponse operationResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image_list_single_page.json")).build();
-
- ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
- TOKEN_RESPONSE, list, operationResponse).images();
-
- Iterator<ListPage<Image>> images = imageApi.list();
-
- assertEquals(images.next().size(), 3);
- }
-
- public void multiplePagesProjectScoped() {
- HttpRequest list1 = HttpRequest
- .builder()
- .method("GET")
- .endpoint(BASE_URL + "/party/global/images?maxResults=1")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Bearer " + TOKEN).build();
-
- HttpRequest list2 = list1.toBuilder()
- .endpoint(BASE_URL + "/party/global/images?pageToken=token1&maxResults=1").build();
-
- HttpRequest list3 = list1.toBuilder()
- .endpoint(BASE_URL + "/party/global/images?pageToken=token2&maxResults=1").build();
-
- List<Image> items = ImmutableList.of(new ParseImageTest().expected());
-
- HttpResponse list1Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, "token1"))).build();
-
- HttpResponse list2Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, "token2"))).build();
-
- HttpResponse list3Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, null))).build();
-
- ImageApi imageApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
- TOKEN_RESPONSE, list1, list1Response, list2, list2Response, list3, list3Response).images();
-
- Iterator<ListPage<Image>> images = imageApi.list(maxResults(1));
-
- int imageCounter = 0;
- while (images.hasNext()) {
- imageCounter += images.next().size();
- }
- assertEquals(imageCounter, 3);
- }
-
- public void multiplePagesRegionScoped() {
- HttpRequest list1 = HttpRequest
- .builder()
- .method("GET")
- .endpoint(BASE_URL + "/party/regions/us-central1/addresses?maxResults=1")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Bearer " + TOKEN).build();
-
- HttpRequest list2 = list1.toBuilder()
- .endpoint(BASE_URL + "/party/regions/us-central1/addresses?pageToken=token1&maxResults=1").build();
-
- HttpRequest list3 = list1.toBuilder()
- .endpoint(BASE_URL + "/party/regions/us-central1/addresses?pageToken=token2&maxResults=1").build();
-
- List<Address> items = ImmutableList.of(new ParseAddressTest().expected());
-
- HttpResponse list1Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, "token1"))).build();
-
- HttpResponse list2Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, "token2"))).build();
-
- HttpResponse list3Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, null))).build();
-
- AddressApi addressApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
- TOKEN_RESPONSE, list1, list1Response, list2, list2Response, list3, list3Response)
- .addressesInRegion("us-central1");
-
- Iterator<ListPage<Address>> addresses = addressApi.list(maxResults(1));
-
- int addressCounter = 0;
- while (addresses.hasNext()) {
- addressCounter += addresses.next().size();
- }
- assertEquals(addressCounter, 3);
- }
-
- public void multiplePagesZoneScoped() {
- HttpRequest list1 = HttpRequest
- .builder()
- .method("GET")
- .endpoint(BASE_URL + "/party/zones/us-central1-a/instances?maxResults=1")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Bearer " + TOKEN).build();
-
- HttpRequest list2 = list1.toBuilder()
- .endpoint(BASE_URL + "/party/zones/us-central1-a/instances?pageToken=token1&maxResults=1").build();
-
- HttpRequest list3 = list1.toBuilder()
- .endpoint(BASE_URL + "/party/zones/us-central1-a/instances?pageToken=token2&maxResults=1").build();
-
- List<Instance> items = ImmutableList.of(new ParseInstanceTest().expected());
-
- HttpResponse list1Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, "token1"))).build();
-
- HttpResponse list2Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, "token2"))).build();
-
- HttpResponse list3Response = HttpResponse.builder().statusCode(200)
- .payload(json.toJson(ForwardingListPage.create(items, null))).build();
-
- InstanceApi instanceApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
- TOKEN_RESPONSE, list1, list1Response, list2, list2Response, list3, list3Response)
- .instancesInZone("us-central1-a");
-
- Iterator<ListPage<Instance>> instances = instanceApi.list(maxResults(1));
-
- int instanceCounter = 0;
- while (instances.hasNext()) {
- instanceCounter += instances.next().size();
- }
- assertEquals(instanceCounter, 3);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java
deleted file mode 100644
index 50d58ed..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.Address.Status;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseAddressListTest")
-public class ParseAddressListTest extends BaseGoogleComputeEngineParseTest<ListPage<Address>> {
-
- @Override
- public String resource() {
- return "/address_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Address> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Address> expected(String baseUrl) {
- Address address1 = new ParseAddressTest().expected(baseUrl);
- Address address2 = Address.create( //
- "4881363978908129158", // id
- URI.create(baseUrl + "/party/regions/us-central1/addresses/test-ip2"), // selfLink
- "test-ip2", // name
- parse("2013-07-26T14:08:21.552-07:00"), //creationTimestamp
- "", // description
- Status.RESERVED, // status
- null, // users
- URI.create(baseUrl + "/party/regions/us-central1"), // region
- "173.255.118.115" // address
- );
- return ForwardingListPage.create( //
- ImmutableList.of(address1, address2), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java
deleted file mode 100644
index 454822c..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.Address.Status;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseAddressTest")
-public class ParseAddressTest extends BaseGoogleComputeEngineParseTest<Address> {
-
- @Override
- public String resource() {
- return "/address_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Address expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Address expected(String baseUrl) {
- return Address.create( //d
- "4439373783165447583", // id
- URI.create(baseUrl + "/party/regions/us-central1/addresses/test-ip1"), // selfLink
- "test-ip1", // name
- parse("2013-07-26T13:57:20.204-07:00"), // creationTimestamp
- "", // description
- Status.IN_USE, // status
- ImmutableList.of(URI.create(baseUrl + "/party/regions/us-central1-a/forwardingRules/test-forwarding-rule")), // users
- URI.create(baseUrl + "/party/regions/us-central1"), // region
- "173.255.115.190" // address
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceListTest.java
deleted file mode 100644
index 992d446..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceListTest.java
+++ /dev/null
@@ -1,69 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.BackendService;
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseBackendServiceListTest extends BaseGoogleComputeEngineParseTest<ListPage<BackendService>> {
-
- @Override
- public String resource() {
- return "/backend_service_list.json";
- }
-
- @Override
- @Consumes(APPLICATION_JSON)
- public ListPage<BackendService> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<BackendService> expected(String baseUrl) {
- return ForwardingListPage.create(
- ImmutableList.of(
- new ParseBackendServiceTest().expected(baseUrl),
- BackendService.create("12862241067393040785", //id
- new SimpleDateFormatDateService().iso8601DateParse("2012-04-13T03:05:04.365"), //creationTimestamp,
- URI.create(baseUrl + "/myproject/global/backendServices/jclouds-test-2"), //selfLink,
- "jclouds-test-2", //name,
- "Backend Service 2", //description
- null, // backends,
- ImmutableList.of(URI.create(baseUrl + "/myproject/global/httpHealthChecks/jclouds-test")), //healthChecks,
- 45, //timeoutSec,
- 80, //port,
- "HTTP", //protocol,
- null, //fingerprint
- null) // portName
- ),
- null
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceTest.java
deleted file mode 100644
index dc99239..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseBackendServiceTest.java
+++ /dev/null
@@ -1,74 +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.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.BackendService;
-import org.jclouds.googlecomputeengine.domain.BackendService.Backend;
-import org.jclouds.googlecomputeengine.domain.BackendService.Backend.BalancingModes;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseBackendServiceTest extends BaseGoogleComputeEngineParseTest<BackendService> {
-
- @Override
- public String resource() {
- return "/backend_service_get.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public BackendService expected() {
- return expected(BASE_URL);
- }
-
- public BackendService expected(String baseUrl) {
- URI selfLink = URI.create(baseUrl + "/myproject/global/backendServices/jclouds-test");
- URI healthCheck = URI.create(baseUrl + "/myproject/global/httpHealthChecks/jclouds-test");
- URI group = URI.create("https://www.googleapis.com/resourceviews/v1beta1"
- + "/projects/myproject/zones/us-central1-a/"
- + "resourceViews/jclouds-test");
- Backend backend = Backend.create("A resource view", //description
- group, //group
- BalancingModes.UTILIZATION, //balancingMode
- (float) 0.8, //maxUtilization
- null, //maxRate
- null, //maxRatePerInstance
- (float) 1.0); // capacityScaler
- return BackendService.create("15448612110458377529", //id
- new SimpleDateFormatDateService().iso8601DateParse("2014-07-18T13:37:48.574-07:00"), //creationTimestamp
- selfLink, //selfLink
- "jclouds-test", //name
- "Backend service", // description
- ImmutableList.of(backend), //backends
- ImmutableList.of(healthCheck), //healthChecks
- 30, //timeoutSec
- 80, //port
- "HTTP", //protocol
- "I6n5NPSXn8g=", //fingerprint
- null // portName
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java
deleted file mode 100644
index 2f6ca3d..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseDiskListTest")
-public class ParseDiskListTest extends BaseGoogleComputeEngineParseTest<ListPage<Disk>> {
-
- @Override
- public String resource() {
- return "/disk_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Disk> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Disk> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseDiskTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java
deleted file mode 100644
index d7784bb..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java
+++ /dev/null
@@ -1,62 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Disk.Status;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseDiskTest")
-public class ParseDiskTest extends BaseGoogleComputeEngineParseTest<Disk> {
-
- @Override
- public String resource() {
- return "/disk_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Disk expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Disk expected(String baseUrl){
- return Disk.create( //
- "13050421646334304115", // id
- parse("2012-11-25T01:38:48.306"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a"), // zone
- Status.READY, // status
- "testimage1", // name
- null, // description
- 1, // sizeGb
- null, // sourceSnapshot
- null, // sourceSnapshotId
- URI.create(baseUrl + "/party/zones/us-central1-a/disks/testimage1"), // selfLink
- null, // sourceImage
- null, // sourceImageId
- URI.create(baseUrl + "/studied-point-720/zones/us-central1-a/diskTypes/pd-standard"), // type
- null // license
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeListTest.java
deleted file mode 100644
index b796186..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeListTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseDiskTypeListTest")
-public class ParseDiskTypeListTest extends BaseGoogleComputeEngineParseTest<ListPage<DiskType>> {
-
- @Override
- public String resource() {
- return "/disktype_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<DiskType> expected() {
- String contentBaseUrl = BASE_URL.replace("www", "content");
- DiskType diskType1 = DiskType.create(
- parse("2014-06-02T11:07:28.530-07:00"), // creationTimestamp
- "pd-standard", // name
- "Standard Persistent Disk", // description
- "10GB-10TB", // validDiskSize
- null, // deprecated
- URI.create(contentBaseUrl + "/studied-point-720/zones/us-central1-a"), // zone
- URI.create(contentBaseUrl + "/studied-point-720/zones/us-central1-a/diskTypes/pd-standard"), // selfLink
- 500 // defaultDiskSizeGb
- );
- DiskType diskType2 = new ParseDiskTypeTest().expected();
- return ForwardingListPage.create( //
- ImmutableList.of(diskType1, diskType2), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeTest.java
deleted file mode 100644
index 564977e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTypeTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseDiskTypeTest")
-public class ParseDiskTypeTest extends BaseGoogleComputeEngineParseTest<DiskType> {
-
- @Override
- public String resource() {
- return "/disktype.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public DiskType expected() {
- String contentBaseUrl = BASE_URL.replace("www", "content");
- return DiskType.create(
- parse("2014-06-02T11:07:28.529-07:00"), // creationTimestamp
- "pd-ssd", // name
- "SSD Persistent Disk", // description
- "10GB-1TB", // validDiskSize
- null, // deprecated
- URI.create(contentBaseUrl + "/studied-point-720/zones/us-central1-a"), // zone
- URI.create(contentBaseUrl + "/studied-point-720/zones/us-central1-a/diskTypes/pd-ssd"), // selfLink
- 100 // defaultDiskSizeGb
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java
deleted file mode 100644
index 0fa6737..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseFirewallListTest")
-public class ParseFirewallListTest extends BaseGoogleComputeEngineParseTest<ListPage<Firewall>> {
-
- @Override
- public String resource() {
- return "/firewall_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Firewall> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Firewall> expected(String baseUrl) {
- Firewall firewall1 = new ParseFirewallTest().expected(baseUrl);
- Firewall firewall2 = Firewall.create( //
- "12862241067393040785", // id
- URI.create(baseUrl + "/google/global/firewalls/default-ssh"), // selfLink
- parse("2012-04-13T03:05:04.365"), // creationTimestamp
- "default-ssh", // name
- "SSH allowed from anywhere", // description
- URI.create(baseUrl + "/google/global/networks/default"), // network
- ImmutableList.of("0.0.0.0/0"), // sourceRanges
- null, // sourceTags
- null, // targetTags
- ImmutableList.of(Firewall.Rule.create("tcp", ImmutableList.of("22"))) // allowed
- );
- return ForwardingListPage.create( //
- ImmutableList.of(firewall1, firewall2), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java
deleted file mode 100644
index 4a20dc7..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.Firewall.Rule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseFirewallTest")
-public class ParseFirewallTest extends BaseGoogleComputeEngineParseTest<Firewall> {
-
- @Override
- public String resource() {
- return "/firewall_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Firewall expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Firewall expected(String base_url) {
- return Firewall.create( //
- "12862241031274216284", // id
- URI.create(base_url + "/party/global/firewalls/jclouds-test"), // selfLink
- parse("2012-04-13T03:05:02.855"), // creationTimestamp
- "jclouds-test", // name
- "Internal traffic from default allowed", // description
- URI.create(base_url + "/party/global/networks/jclouds-test"), // network
- ImmutableList.of("10.0.0.0/8"), // sourceRanges
- null, // sourceTags
- null, // targetTags
- ImmutableList.of( // allowed
- Rule.create("tcp", ImmutableList.of("1-65535")), //
- Rule.create("udp", ImmutableList.of("1-65535")), //
- Rule.create("icmp", null) //
- ));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleListTest.java
deleted file mode 100644
index 9e17644..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleListTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseForwardingRuleListTest")
-public class ParseForwardingRuleListTest extends BaseGoogleComputeEngineParseTest<ListPage<ForwardingRule>> {
-
- @Override
- public String resource() {
- return "/forwardingrule_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<ForwardingRule> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<ForwardingRule> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseForwardingRuleTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleTest.java
deleted file mode 100644
index ce21f9b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleTest.java
+++ /dev/null
@@ -1,57 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseForwardingRuleTest")
-public class ParseForwardingRuleTest extends BaseGoogleComputeEngineParseTest<ForwardingRule> {
-
- @Override
- public String resource() {
- return "/forwardingrule_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ForwardingRule expected() {
- return expected(BASE_URL);
- }
-
- public ForwardingRule expected(String baseUrl) {
- return ForwardingRule.create( //
- "6732523704970219884", // id
- URI.create(baseUrl + "/party/regions/europe-west1/forwardingRules/test-forwarding-rule"), // selfLink
- "test-forwarding-rule", // name
- null, // description
- new SimpleDateFormatDateService().iso8601DateParse("2014-01-08T06:51:10.809-08:00"), // creationTimestamp
- URI.create(baseUrl + "/party/regions/europe-west1"), // region
- "23.251.129.77", // ipAddress
- ForwardingRule.IPProtocol.TCP, // ipProtocol
- "1-65535", // portRange
- URI.create(baseUrl + "/party/regions/europe-west1/targetPools/test-target-pool") // target
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleListTest.java
deleted file mode 100644
index 45b6159..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleListTest.java
+++ /dev/null
@@ -1,46 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseGlobalForwardingRuleListTest")
-public class ParseGlobalForwardingRuleListTest extends BaseGoogleComputeEngineParseTest<ListPage<ForwardingRule>> {
-
- @Override
- public String resource() {
- return "/global_forwarding_rule_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<ForwardingRule> expected() {
- return ForwardingListPage.create(
- ImmutableList.of(new ParseGlobalForwardingRuleTest().expected()), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleTest.java
deleted file mode 100644
index d797378..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalForwardingRuleTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule.IPProtocol;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-
-public class ParseGlobalForwardingRuleTest extends BaseGoogleComputeEngineParseTest<ForwardingRule> {
-
- @Override
- public String resource() {
- return "/global_forwarding_rule_get.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public ForwardingRule expected() {
- return ForwardingRule.create("8192211304399313984", // id
- URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/forwardingRules/jclouds-test"), // selfLink
- "jclouds-test", // name
- "tcp forwarding rule", // description
- new SimpleDateFormatDateService().iso8601DateParse("2014-07-18T09:47:30.826-07:00"), // creationTimestamp
- null, // region
- "107.178.255.156", //IPAddress
- IPProtocol.TCP, //IPProtocol
- "80-80", // portRange
- URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test") // Target
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationListTest.java
deleted file mode 100644
index 1a837ea..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationListTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseGlobalOperationListTest")
-public class ParseGlobalOperationListTest extends BaseGoogleComputeEngineParseTest<ListPage<Operation>> {
-
- @Override
- public String resource() {
- return "/global_operation_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Operation> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Operation> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseGlobalOperationTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationTest.java
deleted file mode 100644
index 2d12ba9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationTest.java
+++ /dev/null
@@ -1,69 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseGlobalOperationTest")
-public class ParseGlobalOperationTest extends BaseGoogleComputeEngineParseTest<Operation> {
-
- @Override
- public String resource() {
- return "/global_operation.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Operation expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Operation expected(String baseUrl) {
- return Operation.create( //
- "13053095055850848306", // id
- parse("2013-07-26T13:57:20.204-07:00"), // creationTimestamp
- URI.create(baseUrl + "/party/global/operations/operation-1354084865060"),
- "operation-1354084865060", // name
- null, // description
- URI.create(baseUrl + "/party/global/firewalls/jclouds-test-delete"), // targetLink
- "13053094017547040099", // targetId
- null, // clientOperationId
- Operation.Status.DONE, // status
- null, // statusMessage
- "user@developer.gserviceaccount.com", // user
- 100, // progress
- parse("2012-11-28T06:41:05.060"), // insertTime
- parse("2012-11-28T06:41:05.142"), // startTime
- parse("2012-11-28T06:41:06.142"), // endTime
- null, // httpErrorStatusCode
- null, // httpErrorMessage
- "insert", // operationType
- null, // errors
- null, // warnings
- null, // region
- null // zone
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHealthStatusTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHealthStatusTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHealthStatusTest.java
deleted file mode 100644
index b425db9..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHealthStatusTest.java
+++ /dev/null
@@ -1,58 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.HealthStatus;
-import org.jclouds.googlecomputeengine.domain.HealthStatus.HealthStatusInternal;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit")
-public class ParseHealthStatusTest extends BaseGoogleComputeEngineParseTest<HealthStatus> {
-
- @Override
- public String resource() {
- return "/health_status_get_health.json";
- }
-
- @Override
- @Consumes(APPLICATION_JSON)
- public HealthStatus expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public HealthStatus expected(String baseUrl) {
- URI uri = URI.create(baseUrl + "/party/zones/us-central1-a/instances/"
- + "jclouds-test");
- return HealthStatus.create(
- ImmutableList.of(HealthStatusInternal.create(
- null, // ipAddress
- 80, // port
- uri, // instance
- "HEALTHY" //healthState
- )) //healthStatuses
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckListTest.java
deleted file mode 100644
index 360bc2b..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckListTest.java
+++ /dev/null
@@ -1,84 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.HttpHealthCheck;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseHttpHealthCheckListTest")
-public class ParseHttpHealthCheckListTest extends BaseGoogleComputeEngineParseTest<ListPage<HttpHealthCheck>> {
-
- @Override
- public String resource() {
- return "/httphealthcheck_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<HttpHealthCheck> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<HttpHealthCheck> expected(String baseUrl) {
- HttpHealthCheck healthCheck1 = new ParseHttpHealthCheckTest().expected(baseUrl);
- HttpHealthCheck healthCheck2 = HttpHealthCheck.create( //
- "1035854271083519643", // id
- URI.create(baseUrl + "/party-gce/global/httpHealthChecks/myname-andrea-kmzmi1bh-http-health-check"),
- // selfLink
- parse("2014-01-08T14:38:29.363-08:00"),
- "myname-andrea-kmzmi1bh-http-health-check", // name
- null, // description
- null, // host
- null, // requestPath
- null, // port
- null, // checkIntervalSec
- 5, // timeoutSec
- 2, // unhealthyThreshold
- null // healthyThreshold
- );
- HttpHealthCheck healthCheck3 = HttpHealthCheck.create( //
- "7006563292274658743", // id
- URI.create(baseUrl + "/party-gce/global/httpHealthChecks/myname-andrea-zk7gadwq-http-health-check"),
- // selfLink
- parse("2014-01-08T14:48:03.276-08:00"), // creationTimestamp
- "myname-andrea-zk7gadwq-http-health-check", // name
- null, // description
- null, // host
- null, // requestPath
- null, // port
- null, // checkIntervalSec
- 5, // timeoutSec
- 2, // unhealthyThreshold
- null // healthyThreshold
- );
- return ForwardingListPage.create( //
- ImmutableList.of(healthCheck1, healthCheck2, healthCheck3), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckTest.java
deleted file mode 100644
index 2e655f7..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseHttpHealthCheckTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.HttpHealthCheck;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseHttpHealthCheckTest")
-public class ParseHttpHealthCheckTest extends BaseGoogleComputeEngineParseTest<HttpHealthCheck> {
-
- @Override
- public String resource() {
- return "/httphealthcheck_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public HttpHealthCheck expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public HttpHealthCheck expected(String baseUrl) {
- return HttpHealthCheck.create( //
- "2761502483700014319", // id
- URI.create(baseUrl + "/party-gce/global/httpHealthChecks/http-health-check-api-live-test"), // selfLink
- parse("2014-01-14T05:55:54.910-08:00"), // creationTimestamp
- "http-health-check-api-live-test", // name
- "Test Health Check", // description
- null, // host
- "/", // requestPath
- 80, // port
- 5, // checkIntervalSec
- 5, // timeoutSec
- 2, // unhealthyThreshold
- 2 // healthyThreshold
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageListTest.java
deleted file mode 100644
index 16c66e5..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageListTest.java
+++ /dev/null
@@ -1,50 +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.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseImageListTest")
-public class ParseImageListTest extends BaseGoogleComputeEngineParseTest<ListPage<Image>> {
-
- @Override
- public String resource() {
- return "/image_list.json";
- }
-
- @Override @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<Image> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(MediaType.APPLICATION_JSON)
- public ListPage<Image> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseImageTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java
deleted file mode 100644
index 6306df2..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java
+++ /dev/null
@@ -1,74 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.domain.Image.RawDisk;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.Deprecated;
-import org.jclouds.googlecomputeengine.domain.Deprecated.State;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Image.Status;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseImageTest")
-public class ParseImageTest extends BaseGoogleComputeEngineParseTest<Image> {
-
- @Override
- public String resource() {
- return "/image_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Image expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Image expected(String baseUrl) {
- return Image.create( //
- "12941197498378735318", // id
- URI.create(baseUrl + "/centos-cloud/global/images/centos-6-2-v20120326"), // selfLink
- parse("2012-07-16T22:16:13.468"), // creationTimestamp
- "centos-6-2-v20120326", // name
- "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000", // description
- "RAW", // sourceType
- RawDisk.create(URI.create(""), "TAR", null), // rawDisk
- Deprecated.create( // deprecated
- State.DEPRECATED, // state
- URI.create(baseUrl + "/centos-cloud/global/images/centos-6-v20130104"), // replacement
- null, // deprecated
- null, // obsolete
- null // deleted
- ),
- Status.READY, // status
- Long.parseLong("881210631", 10), // archivedSizeBytes
- Long.parseLong("8", 10), // diskSizeGb
- baseUrl + "/party/zones/us-central1-a/disk/disk", // sourceDisk
- "9598530021316715047", // sourceDiskId
- ImmutableList.of(baseUrl + "/suse-cloud/global/licenses/sles-12") // license
- );
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java
deleted file mode 100644
index 67acdc5..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java
+++ /dev/null
@@ -1,51 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecloud.domain.ForwardingListPage;
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "ParseInstanceListTest")
-public class ParseInstanceListTest extends BaseGoogleComputeEngineParseTest<ListPage<Instance>> {
-
- @Override
- public String resource() {
- return "/instance_list.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public ListPage<Instance> expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public ListPage<Instance> expected(String baseUrl) {
- return ForwardingListPage.create( //
- ImmutableList.of(new ParseInstanceTest().expected(baseUrl)), // items
- null // nextPageToken
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceSerialOutputTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceSerialOutputTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceSerialOutputTest.java
deleted file mode 100644
index 5b8eca5..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceSerialOutputTest.java
+++ /dev/null
@@ -1,48 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseInstanceSerialOutputTest")
-public class ParseInstanceSerialOutputTest extends BaseGoogleComputeEngineParseTest<SerialPortOutput> {
-
- @Override
- public String resource() {
- return "/instance_serial_port.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public SerialPortOutput expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public SerialPortOutput expected(String baseUrl) {
- return SerialPortOutput.create(
- URI.create(baseUrl + "/party/zones/us-central1-a/instances/test-instance/serialPort"),
- "console output");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java
deleted file mode 100644
index 2a75143..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import javax.ws.rs.Consumes;
-import java.net.URI;
-
-import com.google.common.collect.ImmutableList;
-import org.jclouds.googlecomputeengine.domain.AttachDisk;
-import org.jclouds.googlecomputeengine.domain.AttachDisk.DiskInterface;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Instance.AttachedDisk;
-import org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling.OnHostMaintenance;
-import org.jclouds.googlecomputeengine.domain.Instance.ServiceAccount;
-import org.jclouds.googlecomputeengine.domain.Metadata;
-import org.jclouds.googlecomputeengine.domain.Tags;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseInstanceTest")
-public class ParseInstanceTest extends BaseGoogleComputeEngineParseTest<Instance> {
-
- @Override
- public String resource() {
- return "/instance_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public Instance expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public Instance expected(String baseUrl) {
- return Instance.create( //
- "13051190678907570425", // id
- parse("2012-11-25T23:48:20.758"), // creationTimestamp
- URI.create(baseUrl + "/party/zones/us-central1-a/instances/test-0"), // selfLink
- "test-0", // name
- "desc", // description
- Tags.create("abcd", ImmutableList.of("aTag", "Group-port-42")), // tags
- URI.create(baseUrl + "/party/zones/us-central1-a/machineTypes/n1-standard-1"), // machineType
- Instance.Status.RUNNING, // status
- null, // statusMessage
- URI.create(baseUrl + "/party/zones/us-central1-a"), // zone
- true, // canIpForward
- ImmutableList.of(NetworkInterface.create( //
- "nic0", // name
- URI.create(baseUrl + "/party/global/networks/default"), // network
- "10.240.121.115", // networkIP
- null // accessConfigs
- )), // networkInterfaces
- ImmutableList.of(AttachedDisk.create( //
- 0, // index
- AttachedDisk.Type.PERSISTENT, // type
- AttachedDisk.Mode.READ_WRITE, // mode
- URI.create(baseUrl + "/party/zones/us-central1-a/disks/test"), // source
- "test", // deviceName
- false, // autoDelete
- true, // boot
- AttachDisk.InitializeParams.create(
- "test", // diskName
- Long.parseLong("100", 10), // diskSizeGb
- URI.create(baseUrl + "/debian-cloud/global/images/debian-7-wheezy-v20140718"), // sourceImage
- URI.create(baseUrl + "/party/zones/us-central1-a/diskTypes/pd-standard") // diskType
- ), // initializeParams
- ImmutableList.of(baseUrl + "/suse-cloud/global/licenses/sles-12"), // licenses
- DiskInterface.NVME // interface
- )), // disks
- Metadata.create("efgh")
- .put("aKey", "aValue")
- .put("jclouds-delete-boot-disk", "true"), // metadata
- ImmutableList.of(ServiceAccount.create("default", ImmutableList.of("myscope"))), // serviceAccounts
- Instance.Scheduling.create(OnHostMaintenance.MIGRATE, false) // scheduling
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseLicenseTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseLicenseTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseLicenseTest.java
deleted file mode 100644
index 519c4d5..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseLicenseTest.java
+++ /dev/null
@@ -1,46 +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.parse;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-
-import org.jclouds.googlecomputeengine.domain.License;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseLicenseTest")
-public class ParseLicenseTest extends BaseGoogleComputeEngineParseTest<License> {
-
- @Override
- public String resource() {
- return "/license_get.json";
- }
-
- @Override @Consumes(APPLICATION_JSON)
- public License expected() {
- return expected(BASE_URL);
- }
-
- @Consumes(APPLICATION_JSON)
- public License expected(String baseUrl) {
- return License.create(URI.create(baseUrl + "/suse-cloud/global/licenses/sles-12"), "sles-12", true);
- }
-}
[15/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineHttpApiModule.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineHttpApiModule.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineHttpApiModule.java
deleted file mode 100644
index 2a813d1..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineHttpApiModule.java
+++ /dev/null
@@ -1,143 +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;
-
-import static com.google.common.base.Suppliers.compose;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.PROJECT_NAME;
-import static org.jclouds.rest.config.BinderUtils.bindHttpApi;
-
-import java.net.URI;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.jclouds.domain.Credentials;
-import org.jclouds.googlecloud.config.CurrentProject;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Project;
-import org.jclouds.googlecomputeengine.handlers.GoogleComputeEngineErrorHandler;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.Redirection;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.location.Provider;
-import org.jclouds.oauth.v2.config.OAuthScopes;
-import org.jclouds.oauth.v2.config.OAuthScopes.ReadOrWriteScopes;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-import org.jclouds.rest.config.HttpApiModule;
-import org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier;
-
-import com.google.common.base.Function;
-import com.google.common.base.Strings;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.inject.Provides;
-
-@ConfiguresHttpApi
-public final class GoogleComputeEngineHttpApiModule extends HttpApiModule<GoogleComputeEngineApi> {
-
- @Override protected void configure() {
- super.configure();
- 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() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(GoogleComputeEngineErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(GoogleComputeEngineErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(GoogleComputeEngineErrorHandler.class);
- }
-
- @Provides @Singleton @CurrentProject Supplier<URI> project(@Named(PROJECT_NAME) final String projectName,
- @Provider Supplier<URI> defaultEndpoint, final UseApiToResolveProjectName useApiToResolveProjectName,
- @Provider final Supplier<Credentials> creds, AtomicReference<AuthorizationException> authException,
- @Named(PROPERTY_SESSION_INTERVAL) long seconds) {
- // Try to avoid a runtime lookup by accepting a project name supplied in context overrides.
- if (Strings.emptyToNull(projectName) != null) {
- return Suppliers.memoizeWithExpiration(Suppliers.compose(new Function<URI, URI>() {
- @Override public URI apply(URI input) {
- return URI.create(String.format("%s/projects/%s", input, projectName));
- }
- }, defaultEndpoint), seconds, SECONDS);
- }
-
- // If the project name wasn't explicitly supplied, then we lookup via api.
- // This supplier must be defensive against any auth exception.
- return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier
- .create(authException, compose(useApiToResolveProjectName, creds), seconds, SECONDS);
- }
-
- /**
- * Parse the project ID from the identity, use it to lookup the project name, return the project-scoped uri.
- *
- * <h3>Why are we looking up the project name? We already have the project ID!</h3>
- * <a href="https://cloud.google.com/compute/docs/overview#projectids">Documentation</a> suggests that the
- * project name is interchangeable with the project ID, which we already have. However, in practice, using the
- * project ID leads to problems in POST requests.
- *
- * <p/> For example, inserting an instance using the project ID in the instances url, but the project name in
- * the machineType url results in an error of
- * <pre>{@code Cross-project references for this resource type are not allowed}.</pre>
- *
- * <p/>Similar errors occur in POST requests to other resources including at least forwardingRules, images,
- * targetPools.
- */
- static final class UseApiToResolveProjectName implements Function<Credentials, URI> {
-
- @SkipEncoding({ '/', '=' })
- @RequestFilters(OAuthFilter.class)
- @Consumes(APPLICATION_JSON)
- interface GetProject {
- @Named("Projects:get")
- @GET
- @Path("/projects/{projectNumber}") Project get(@PathParam("projectNumber") String projectNumber);
- }
-
- private final GetProject api;
- private final Supplier<URI> defaultEndpoint;
- private final String identityName;
-
- @Inject
- UseApiToResolveProjectName(GetProject api, @Provider Supplier<URI> defaultEndpoint, ProviderMetadata metadata) {
- this.api = api;
- this.defaultEndpoint = defaultEndpoint;
- this.identityName = metadata.getApiMetadata().getIdentityName();
- }
-
- @Override public URI apply(Credentials in) {
- String projectNumber = CurrentProject.ClientEmail.toProjectNumber(in.identity);
- return URI.create(defaultEndpoint.get() + "/projects/" + api.get(projectNumber).name());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java
deleted file mode 100644
index a0c7fdd..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java
+++ /dev/null
@@ -1,137 +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;
-
-import static org.jclouds.googlecomputeengine.domain.Firewall.Rule;
-
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Singleton;
-
-import org.jclouds.googlecloud.config.ListPageAdapterFactory;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.jclouds.googlecomputeengine.options.RouteOptions;
-import org.jclouds.json.config.GsonModule;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import com.google.gson.TypeAdapterFactory;
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-
-public final class GoogleComputeEngineParserModule extends AbstractModule {
-
- @Override protected void configure() {
- bind(GsonModule.DateAdapter.class).to(GsonModule.Iso8601DateAdapter.class);
- }
-
- @Provides @Singleton Map<Type, Object> typeAdapters() {
- return new ImmutableMap.Builder<Type, Object>()
- .put(FirewallOptions.class, new FirewallOptionsTypeAdapter())
- .put(RouteOptions.class, new RouteOptionsTypeAdapter()).build();
- }
-
- // TODO: change jclouds core to use collaborative set bindings
- @Provides @Singleton Set<TypeAdapterFactory> typeAdapterFactories() {
- return ImmutableSet.<TypeAdapterFactory>of(new ListPageAdapterFactory());
- }
-
- private static final class FirewallOptionsTypeAdapter implements JsonSerializer<FirewallOptions> {
-
- @Override public JsonElement serialize(FirewallOptions src, Type typeOfSrc, JsonSerializationContext context) {
- JsonObject firewall = new JsonObject();
- if (src.name() != null) {
- firewall.addProperty("name", src.name());
- }
- if (src.network() != null) {
- firewall.addProperty("network", src.network().toString());
- }
- if (!src.sourceRanges().isEmpty()) {
- firewall.add("sourceRanges", buildArrayOfStrings(src.sourceRanges()));
- }
- if (!src.sourceTags().isEmpty()) {
- firewall.add("sourceTags", buildArrayOfStrings(src.sourceTags()));
- }
- if (!src.targetTags().isEmpty()) {
- firewall.add("targetTags", buildArrayOfStrings(src.targetTags()));
- }
- if (!src.getAllowed().isEmpty()) {
- JsonArray rules = new JsonArray();
- for (Rule rule : src.getAllowed()) {
- rules.add(context.serialize(rule, Firewall.Rule.class));
- }
- firewall.add("allowed", rules);
- }
- return firewall;
- }
- }
-
- private static final class RouteOptionsTypeAdapter implements JsonSerializer<RouteOptions> {
-
- @Override public JsonElement serialize(RouteOptions src, Type typeOfSrc, JsonSerializationContext context) {
- JsonObject route = new JsonObject();
- if (src.name() != null) {
- route.addProperty("name", src.name());
- }
- if (src.getNetwork() != null) {
- route.addProperty("network", src.getNetwork().toString());
- }
- if (src.getNextHopGateway() != null) {
- route.addProperty("nextHopGateway", src.getNextHopGateway().toString());
- }
- if (src.getNextHopInstance() != null) {
- route.addProperty("nextHopInstance", src.getNextHopInstance().toString());
- }
- if (src.getNextHopNetwork() != null) {
- route.addProperty("nextHopNetwork", src.getNextHopNetwork().toString());
- }
- if (src.getDestRange() != null) {
- route.addProperty("destRange", src.getDestRange());
- }
- if (src.getDescription() != null) {
- route.addProperty("description", src.getDescription());
- }
- if (src.getPriority() != null) {
- route.addProperty("priority", src.getPriority());
- }
- if (src.getNextHopIp() != null) {
- route.addProperty("nextHopIp", src.getNextHopIp());
- }
- if (!src.getTags().isEmpty()) {
- route.add("tags", buildArrayOfStrings(src.getTags()));
- }
- return route;
- }
- }
-
- private static JsonArray buildArrayOfStrings(Iterable<String> strings) {
- JsonArray array = new JsonArray();
- for (String string : strings) {
- array.add(new JsonPrimitive(string));
- }
- return array;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineProperties.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineProperties.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineProperties.java
deleted file mode 100644
index 526ea93..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineProperties.java
+++ /dev/null
@@ -1,39 +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;
-
-import com.google.common.annotations.Beta;
-
-/**
- * Configuration properties keys used in {@link org.jclouds.ContextBuilder#overrides(java.util.Properties)}.
- * <p/> Note that these are in addition to properties defined in {@link org.jclouds.googlecloud.config.GoogleCloudProperties}.
- */
-public final class GoogleComputeEngineProperties {
-
- /** The total time, in msecs, to wait for an operation to complete. */
- @Beta
- public static final String OPERATION_COMPLETE_TIMEOUT = "jclouds.google-compute-engine.operation-complete-timeout";
- /** The interval, in msecs, between calls to check whether an operation has completed. */
- @Beta
- public static final String OPERATION_COMPLETE_INTERVAL = "jclouds.google-compute-engine.operation-complete-interval";
- /** The list of projects that will be scanned looking for images. */
- @Beta
- public static final String IMAGE_PROJECTS = "jclouds.google-compute-engine.image-projects";
-
- private GoogleComputeEngineProperties() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java
deleted file mode 100644
index ff7226d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java
+++ /dev/null
@@ -1,69 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Address {
-
- public enum Status{
- RESERVED,
- IN_USE;
- }
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- public abstract Date creationTimestamp();
-
- @Nullable public abstract String description();
-
- /**
- * The status of the address. Valid items are RESERVED and IN USE.
- * A reserved address is currently available to the project and can be
- * used by a resource. An in-use address is currently being used by a resource.
- */
- public abstract Status status();
-
- /** URL of the resource currently using this address. */
- @Nullable public abstract List<URI> users();
-
- /** URL of the region where the address resides. */
- public abstract URI region();
-
- /** The IP address represented by this resource. */
- public abstract String address();
-
- @SerializedNames({ "id", "selfLink", "name", "creationTimestamp", "description", "status", "users", "region", "address" })
- public static Address create(String id, URI selfLink, String name, Date creationTimestamp, String description, Status status, List<URI> users,
- URI region, String address) {
- return new AutoValue_Address(id, selfLink, name, creationTimestamp, description, status, users, region, address);
- }
-
- Address() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AttachDisk.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AttachDisk.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AttachDisk.java
deleted file mode 100644
index 5c34818..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AttachDisk.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.domain;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class AttachDisk {
- @AutoValue
- public abstract static class InitializeParams {
- /** Override the default naming convention. */
- @Nullable public abstract String diskName();
-
- /** Set to use a size larger than the {@link #sourceImage()}. You need to repartition when set. */
- @Nullable public abstract Long diskSizeGb();
-
- /** The {@link org.jclouds.googlecomputeengine.domain.Image#selfLink() source image}. */
- public abstract URI sourceImage();
-
- @Nullable public abstract URI diskType();
-
- static InitializeParams create(URI sourceImage) {
- return create(null, null, sourceImage, null);
- }
-
- static InitializeParams create(URI sourceImage, URI diskType) {
- return create(null, null, sourceImage, diskType);
- }
-
- @SerializedNames({ "diskName", "diskSizeGb", "sourceImage", "diskType" })
- public static InitializeParams create(String diskName, Long diskSizeGb, URI sourceImage, URI diskType) {
- return new AutoValue_AttachDisk_InitializeParams(diskName, diskSizeGb, sourceImage, diskType);
- }
-
- InitializeParams() {
- }
- }
-
- public enum Type {
- PERSISTENT,
- SCRATCH;
- }
-
- public enum Mode {
- READ_WRITE,
- READ_ONLY;
- }
-
- public enum DiskInterface {
- NVME,
- SCSI;
- }
-
- public abstract Type type();
-
- @Nullable public abstract Mode mode();
-
- /** Use an existingBootDisk {@link org.jclouds.googlecomputeengine.domain.Disk#selfLink() boot disk}. */
- @Nullable public abstract URI source();
-
- /**
- * Must be unique within the instance when specified. This represents a unique
- * device name that is reflected into the /dev/ tree of a Linux operating system running within the
- * instance. If not specified, a default will be chosen by the system.
- */
- @Nullable public abstract String deviceName();
-
- /** True if this is a boot disk. VM will use the first partition of the disk for its root filesystem. */
- public abstract boolean boot();
-
- /** Set to automatically create a boot disk */
- @Nullable public abstract InitializeParams initializeParams();
-
- /** True if this disk will be deleted when the instance is delete. */
- public abstract boolean autoDelete();
-
- @Nullable public abstract List<String> licenses();
-
- // Note: this is disks[].interface in the api docs but interface is a Java keyword.
- @Nullable public abstract DiskInterface diskInterface();
-
- public static AttachDisk existingBootDisk(URI existingBootDisk) {
- return create(Type.PERSISTENT, existingBootDisk, null, true, false);
- }
-
- public static AttachDisk newBootDisk(URI sourceImage) {
- return create(Type.PERSISTENT, null, InitializeParams.create(sourceImage), true, true);
- }
-
- public static AttachDisk newBootDisk(URI sourceImage, URI diskType) {
- return create(Type.PERSISTENT, null, InitializeParams.create(sourceImage, diskType), true, true);
- }
-
- public static AttachDisk existingDisk(URI existingDisk) {
- return create(Type.PERSISTENT, existingDisk, null, false, false);
- }
-
- static AttachDisk create(Type type, URI source, InitializeParams initializeParams, boolean boot,
- boolean autoDelete) {
- return create(type, null, source, null, boot, initializeParams, autoDelete, null, null);
- }
-
- @SerializedNames({"type", "mode", "source", "deviceName", "boot", "initializeParams", "autoDelete", "licenses", "interface" })
- public static AttachDisk create(Type type, Mode mode, URI source, String deviceName, boolean boot, InitializeParams initializeParams,
- boolean autoDelete, List<String> licenses, DiskInterface diskInterface) {
- return new AutoValue_AttachDisk(type, mode, source, deviceName, boot, initializeParams, autoDelete, licenses, diskInterface);
- }
-
- AttachDisk() {
- }
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java
deleted file mode 100644
index f4b15c2..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java
+++ /dev/null
@@ -1,103 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class BackendService {
-
- @AutoValue
- public abstract static class Backend {
- public enum BalancingModes{
- RATE,
- UTILIZATION;
- }
-
- @Nullable public abstract String description();
- public abstract URI group();
- @Nullable public abstract BalancingModes balancingMode();
- @Nullable public abstract Float maxUtilization();
- @Nullable public abstract Integer maxRate();
- @Nullable public abstract Float maxRatePerInstance();
- @Nullable public abstract Float capacityScaler();
-
-
- @SerializedNames({ "description", "group", "balancingMode", "maxUtilization", "maxRate",
- "maxRatePerInstance", "capacityScaler" })
- public static Backend create(String description,
- URI group,
- BalancingModes balancingMode,
- Float maxUtilization,
- Integer maxRate,
- Float maxRatePerInstance,
- Float capacityScaler) {
- return new AutoValue_BackendService_Backend(description, group, balancingMode, maxUtilization, maxRate,
- maxRatePerInstance, capacityScaler);
- }
-
- public static Backend create(URI group){
- return create(null, group, null, null, null, null, null);
- }
-
- Backend(){
- }
- }
-
- public abstract String id();
- public abstract Date creationTimestamp();
- public abstract URI selfLink();
- public abstract String name();
- @Nullable public abstract String description();
- @Nullable public abstract List<Backend> backends();
- @Nullable public abstract List<URI> healthChecks();
- @Nullable public abstract int timeoutSec();
- @Nullable public abstract int port();
- @Nullable public abstract String protocol();
- @Nullable public abstract String fingerprint();
- @Nullable public abstract String portName();
-
- /**
- * @param timeoutSec Defaults to 30 when null.
- * @param port Defaults to 80 when null.
- */
- @SerializedNames({ "id", "creationTimestamp", "selfLink", "name", "description",
- "backends", "healthChecks", "timeoutSec", "port", "protocol",
- "fingerprint", "portName"})
- public static BackendService create(String id, Date creationTimestamp, URI selfLink,
- String name, @Nullable String description,
- @Nullable List<Backend> backends, List<URI> healthChecks,
- @Nullable Integer timeoutSec, @Nullable Integer port,
- @Nullable String protocol,
- @Nullable String fingerprint, String portName){
- return new AutoValue_BackendService(id, creationTimestamp, selfLink, name, description,
- backends, healthChecks,
- timeoutSec != null ? timeoutSec : 30,
- port != null ? port : 80,
- protocol, fingerprint, portName);
- }
-
- BackendService(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
deleted file mode 100644
index 77077df..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
+++ /dev/null
@@ -1,64 +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.domain;
-
-import java.net.URI;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/** Deprecation information for an image or kernel */
-@AutoValue
-public abstract class Deprecated {
-
- public enum State{
- DELETED,
- DEPRECATED,
- OBSELETE;
- }
-
- /** The deprecation state of this image. */
- @Nullable public abstract State state();
-
- /** A fully-qualified URL of the suggested replacement for the deprecated image. */
- @Nullable public abstract URI replacement();
-
- /** An optional RFC3339 timestamp for when the deprecation state of this resource will be changed to DEPRECATED. */
- @Nullable public abstract String deprecated();
-
- /**
- * An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to
- * OBSOLETE.
- */
- @Nullable public abstract String obsolete();
-
- /**
- * An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to
- * DELETED.
- */
- @Nullable public abstract String deleted();
-
- @SerializedNames({ "state", "replacement", "deprecated", "obsolete", "deleted" })
- public static Deprecated create(State state, URI replacement, String deprecated, String obsolete, String deleted) {
- return new AutoValue_Deprecated(state, replacement, deprecated, obsolete, deleted);
- }
-
- Deprecated() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
deleted file mode 100644
index 4321347..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
+++ /dev/null
@@ -1,77 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Disk {
-
- public enum Status {
- CREATING,
- FAILED,
- READY,
- RESTORING;
- }
-
- public abstract String id();
-
- public abstract Date creationTimestamp();
-
- public abstract URI zone();
-
- public abstract Status status();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract int sizeGb();
-
- @Nullable public abstract String sourceSnapshot();
-
- @Nullable public abstract String sourceSnapshotId();
-
- public abstract URI selfLink();
-
- @Nullable public abstract URI sourceImage();
-
- @Nullable public abstract String sourceImageId();
-
- /** URL of the corresponding disk type resource. */
- @Nullable public abstract URI type();
-
- @Nullable public abstract List<String> licenses();
-
- @SerializedNames({ "id", "creationTimestamp", "zone", "status", "name", "description", "sizeGb", "sourceSnapshot",
- "sourceSnapshotId", "selfLink", "sourceImage", "sourceImageId", "type", "licenses" })
- public static Disk create(String id, Date creationTimestamp, URI zone, Status status, String name, String description, int sizeGb,
- String sourceSnapshot, String sourceSnapshotId, URI selfLink, URI sourceImage, String sourceImageId, URI type, List<String> licenses) {
- return new AutoValue_Disk(id, creationTimestamp, zone, status, name, description, sizeGb,
- sourceSnapshot, sourceSnapshotId, selfLink, sourceImage, sourceImageId, type, licenses);
- }
-
- Disk(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
deleted file mode 100644
index e1c3fc3..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
+++ /dev/null
@@ -1,56 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class DiskType {
-
- public abstract Date creationTimestamp();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /** Textual description of the valid disk size. For example, "10GB-10TB." */
- @Nullable public abstract String validDiskSize();
-
- @Nullable public abstract Deprecated deprecated();
-
- public abstract URI zone();
-
- public abstract URI selfLink();
-
- /** Server defined default disk size in GB. */
- public abstract long defaultDiskSizeGb();
-
- @SerializedNames({ "creationTimestamp", "name", "description", "validDiskSize", "deprecated", "zone", "selfLink", "defaultDiskSizeGb" })
- public static DiskType create(Date creationTimestamp, String name, String description, String validDiskSize, Deprecated deprecated, URI zone,
- URI selfLink, long defaultDiskSizeGb) {
- return new AutoValue_DiskType(creationTimestamp, name, description, validDiskSize, deprecated, zone, selfLink, defaultDiskSizeGb);
- }
-
- DiskType() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
deleted file mode 100644
index f8acf8d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
+++ /dev/null
@@ -1,109 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Firewall {
-
- /** A protocol and port-range tuple that describes a permitted connection. */
- @AutoValue
- public abstract static class Rule {
- /** This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number. */
- public abstract String ipProtocol();
-
- /**
- * An optional list of ports which are allowed. This is only applicable for UDP or TCP protocol. Each entry must
- * be either an integer or a range (ex. {@code 12345-12349}). If not specified, connections through any port are
- * allowed.
- */
- @Nullable public abstract List<String> ports();
-
- @SerializedNames({ "IPProtocol", "ports" })
- public static Rule create(String ipProtocol, List<String> ports) {
- return new AutoValue_Firewall_Rule(ipProtocol, ports);
- }
-
- Rule() {
- }
- }
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract Date creationTimestamp();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /**
- * @return URI of the network to which this firewall is applied; provided by the client when the firewall is created.
- */
- public abstract URI network();
-
- /**
- * One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or
- * the tag of the source matches.
- *
- * @return a list of IP address blocks expressed in CIDR format which this rule applies to.
- */
- public abstract List<String> sourceRanges();
-
- /**
- * @return a list of instance items which this rule applies to. One or both of sourceRanges and sourceTags may be
- * set; an inbound connection is allowed if either the range or the tag of the source matches.
- */
- public abstract List<String> sourceTags();
-
- /**
- * If no targetTags are specified, the firewall rule applies to all instances on the specified network.
- *
- * @return a list of instance items indicating sets of instances located on network which may make network
- * connections as specified in allowed.
- */
- public abstract List<String> targetTags();
-
- /**
- * Each rule specifies a protocol and port-range tuple that describes a permitted connection.
- *
- * @return the list of rules specified by this firewall.
- */
- public abstract List<Rule> allowed();
-
- @SerializedNames(
- { "id", "selfLink", "creationTimestamp", "name", "description", "network", "sourceRanges", "sourceTags", "targetTags", "allowed" })
- public static Firewall create(String id, URI selfLink, Date creationTimestamp, String name, String description, URI network,
- List<String> sourceRanges, List<String> sourceTags, List<String> targetTags, List<Rule> allowed) {
- return new AutoValue_Firewall(id, selfLink, creationTimestamp, name, description, network, copyOf(sourceRanges), copyOf(sourceTags),
- copyOf(targetTags), copyOf(allowed));
- }
-
- Firewall() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
deleted file mode 100644
index 1e76658..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
+++ /dev/null
@@ -1,88 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class ForwardingRule {
-
- public enum IPProtocol {
- /** IP Authentication Header protocol. */
- AH,
- /** IP Encapsulating Security Payload protocol. */
- ESP,
- /** Stream Control Transmission Protocol. */
- SCTP,
- /** Transmission Control Protocol. */
- TCP,
- /** Specifies the User Datagram Protocol. */
- UDP
- }
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract Date creationTimestamp();
-
- /** null when representing a GlobalForwardingRules */
- @Nullable public abstract URI region();
-
- /**
- * The external IP address that this forwarding rule is serving on behalf of. If this is a reserved
- * address, the address must live in the same region as the forwarding rule. By default,
- * this field is empty and an ephemeral IP is assigned to the ForwardingRule.
- */
- @Nullable public abstract String ipAddress();
-
- public abstract IPProtocol ipProtocol();
-
- /**
- * If IPProtocol is TCP or UDP, packets addressed to ports in the specified range will be forwarded to
- * backend. By default, this is empty and all ports are allowed.
- */
- @Nullable public abstract String portRange();
-
- /**
- * The URL of the target resource to receive the matched traffic. The target resource must live in the
- * same region as this forwarding rule.
- */
- public abstract URI target();
-
- @SerializedNames(
- { "id", "selfLink", "name", "description", "creationTimestamp", "region", "IPAddress", "IPProtocol", "portRange", "target" })
- public static ForwardingRule create(String id, URI selfLink, String name, String description, Date creationTimestamp, URI region,
- String ipAddress, IPProtocol ipProtocol, String portRange, URI target) {
- return new AutoValue_ForwardingRule(id, selfLink, name, description, creationTimestamp, region, ipAddress,
- ipProtocol == null ? IPProtocol.TCP : ipProtocol, portRange, target);
- }
-
- ForwardingRule() {
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HealthStatus.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HealthStatus.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HealthStatus.java
deleted file mode 100644
index 9d8f65b..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HealthStatus.java
+++ /dev/null
@@ -1,56 +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.domain;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class HealthStatus {
-
- public abstract List<HealthStatusInternal> healthStatus();
-
- @SerializedNames({"healthStatus"})
- public static HealthStatus create(List<HealthStatusInternal> healthStatus){
- return new AutoValue_HealthStatus(healthStatus);
- }
-
- HealthStatus(){
- }
-
- @AutoValue
- public abstract static class HealthStatusInternal {
-
- @Nullable public abstract String ipAddress();
- public abstract Integer port();
- public abstract URI instance();
- public abstract String healthState();
-
- @SerializedNames({"ipAddress", "port", "instance", "healthState"})
- public static HealthStatusInternal create(String ipAddress, int port, URI instance, String healthState) {
- return new AutoValue_HealthStatus_HealthStatusInternal(ipAddress, port, instance, healthState);
- }
-
- HealthStatusInternal(){
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
deleted file mode 100644
index 0e3d955..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
+++ /dev/null
@@ -1,75 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class HttpHealthCheck {
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract Date creationTimestamp();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /**
- * The value of the host header in the HTTP health check request. If left empty (default value),
- * the public IP on behalf of which this health check is performed will be used.
- */
- @Nullable public abstract String host();
-
- @Nullable public abstract String requestPath();
-
- /** The TCP port number for the HTTP health check request. */
- @Nullable public abstract Integer port();
-
- /** How often (in seconds) to send a health check. */
- @Nullable public abstract Integer checkIntervalSec();
-
- /** How long (in seconds) to wait before claiming failure. */
- @Nullable public abstract Integer timeoutSec();
-
- /** A so-far healthy VM will be marked unhealthy after this many consecutive failures. */
- @Nullable public abstract Integer unhealthyThreshold();
-
- /** An unhealthy VM will be marked healthy after this many consecutive successes. */
- @Nullable public abstract Integer healthyThreshold();
-
- @SerializedNames(
- { "id", "selfLink", "creationTimestamp", "name", "description", "host", "requestPath", "port", "checkIntervalSec", "timeoutSec",
- "unhealthyThreshold", "healthyThreshold" })
- public static HttpHealthCheck create(String id, URI selfLink, Date creationTimestamp, String name, String description, String host,
- String requestPath, Integer port, Integer checkIntervalSec, Integer timeoutSec, Integer unhealthyThreshold,
- Integer healthyThreshold) {
- return new AutoValue_HttpHealthCheck(id, selfLink, creationTimestamp, name, description, host,
- requestPath, port, checkIntervalSec, timeoutSec, unhealthyThreshold, healthyThreshold);
- }
-
- HttpHealthCheck() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
deleted file mode 100644
index b055ee2..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
+++ /dev/null
@@ -1,106 +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.domain;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class Image {
-
- public enum Status {
- FAILED,
- PENDING,
- READY;
- }
-
- @AutoValue
- public abstract static class RawDisk {
- /**
- * The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk
- * image is created.
- */
- public abstract URI source();
-
- /**
- * The format used to encode and transmit the block device.
- */
- public abstract String containerType();
-
- /**
- * SHA1 checksum of the disk image before unpacking; provided by the client when the disk
- * image is created.
- */
- @Nullable public abstract String sha1Checksum();
-
- @SerializedNames({ "source", "containerType", "sha1Checksum" })
- public static RawDisk create(URI source, String containerType, String sha1Checksum) {
- return new AutoValue_Image_RawDisk(source, containerType, sha1Checksum);
- }
-
- RawDisk() {
- }
- }
-
- public abstract String id();
-
- public abstract URI selfLink();
-
- public abstract Date creationTimestamp();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /** Must be RAW; provided by the client when the disk image is created. */
- // TODO: if this is true, why bother listing it?
- @Nullable public abstract String sourceType();
-
- @Nullable public abstract RawDisk rawDisk();
-
- @Nullable public abstract Deprecated deprecated();
-
- public abstract Status status();
-
- public abstract Long archiveSizeBytes();
-
- public abstract Long diskSizeGb();
-
- @Nullable public abstract String sourceDisk();
-
- @Nullable public abstract String sourceDiskId();
-
- @Nullable public abstract List<String> licenses();
-
- @SerializedNames({ "id", "selfLink", "creationTimestamp", "name", "description", "sourceType", "rawDisk", "deprecated",
- "status", "archiveSizeBytes", "diskSizeGb", "sourceDisk", "sourceDiskId", "licenses"})
- public static Image create(String id, URI selfLink, Date creationTimestamp, String name, String description, String sourceType,
- RawDisk rawDisk, Deprecated deprecated, Status status, Long archiveSizeBytes, Long diskSizeGb,
- String sourceDisk, String sourceDiskId, List<String> licenses) {
- return new AutoValue_Image(id, selfLink, creationTimestamp, name, description, sourceType, rawDisk, deprecated, status,
- archiveSizeBytes, diskSizeGb, sourceDisk, sourceDiskId, licenses);
- }
-
- Image() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java
deleted file mode 100644
index dcbc344..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java
+++ /dev/null
@@ -1,262 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.AttachDisk.DiskInterface;
-import org.jclouds.googlecomputeengine.domain.AttachDisk.InitializeParams;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/** Represents a virtual machine. */
-@AutoValue
-public abstract class Instance {
-
- @AutoValue
- public abstract static class AttachedDisk {
- public enum Type {
- PERSISTENT,
- SCRATCH;
- }
-
- public enum Mode {
- READ_WRITE,
- READ_ONLY;
- }
-
- /** A zero-based index to assign to this disk, where 0 is reserved for the boot disk. */
- @Nullable public abstract int index();
-
- public abstract Type type();
-
- public abstract Mode mode();
-
- /** Corresponds to {@linkplain Disk#selfLink()} when {@linkplain #type()} is {@linkplain Type#PERSISTENT}. */
- @Nullable public abstract URI source();
-
- /**
- * Must be unique within the instance when specified. This represents a unique
- * device name that is reflected into the /dev/ tree of a Linux operating system running within the
- * instance. If not specified, a default will be chosen by the system.
- */
- @Nullable public abstract String deviceName();
-
- public abstract boolean autoDelete();
-
- public abstract boolean boot();
-
- @Nullable public abstract InitializeParams initializeParams();
-
- @Nullable public abstract List<String> licenses();
-
- // Note: this is disks[].interface in the api docs but interface is a Java keyword.
- @Nullable public abstract DiskInterface diskInterface();
-
- @SerializedNames({ "index", "type", "mode", "source", "deviceName", "autoDelete", "boot",
- "initializeParams", "licenses", "interface" })
- public static AttachedDisk create(int index, Type type, Mode mode, URI source, String deviceName,
- boolean autoDelete, boolean boot, InitializeParams initializeParams,
- List<String> licenses, DiskInterface diskInterface) {
- return new AutoValue_Instance_AttachedDisk(index, type, mode, source, deviceName, autoDelete,
- boot, initializeParams, licenses, diskInterface);
- }
-
- AttachedDisk() {
- }
- }
-
- @AutoValue
- public abstract static class NetworkInterface {
- /**
- * This specifies how this interface is configured to interact with other network services,
- * such as connecting to the internet.
- */
- @AutoValue
- public abstract static class AccessConfig {
-
- public enum Type {
- ONE_TO_ONE_NAT
- }
-
- @Nullable public abstract String name();
-
- public abstract Type type();
-
- /** An external IP address associated with this instance, if there is one. */
- @Nullable public abstract String natIP();
-
- @SerializedNames({ "name", "type", "natIP" })
- public static AccessConfig create(String name, Type type, String natIP) {
- return new AutoValue_Instance_NetworkInterface_AccessConfig(name, type, natIP);
- }
-
- AccessConfig() {
- }
- }
-
- public abstract String name();
-
- public abstract URI network();
-
- /** An IPV4 internal network address to assign to this instance. */
- @Nullable public abstract String networkIP();
-
- public abstract List<AccessConfig> accessConfigs();
-
- @SerializedNames({ "name", "network", "networkIP", "accessConfigs" })
- public static NetworkInterface create(String name, URI network, String networkIP,
- List<AccessConfig> accessConfigs) {
- return new AutoValue_Instance_NetworkInterface(name, network, networkIP, copyOf(accessConfigs));
- }
-
- NetworkInterface() {
- }
- }
-
- @AutoValue
- public abstract static class SerialPortOutput {
-
- public abstract URI selfLink();
-
- /** The contents of the console output. */
- public abstract String contents();
-
- @SerializedNames({ "selfLink", "contents" })
- public static SerialPortOutput create(URI selfLink, String contents) {
- return new AutoValue_Instance_SerialPortOutput(selfLink, contents);
- }
-
- SerialPortOutput() {
- }
- }
-
- /**
- * A service account for which access tokens are to be made available to the instance through metadata queries.
- */
- @AutoValue
- public abstract static class ServiceAccount {
-
- public abstract String email();
-
- public abstract List<String> scopes();
-
- @SerializedNames({ "email", "scopes" })
- public static ServiceAccount create(String email, List<String> scopes) {
- return new AutoValue_Instance_ServiceAccount(email, scopes);
- }
-
- ServiceAccount() {
- }
- }
-
- /**
- * Defines the maintenance behavior for this instance. The default behavior is migrate.
- */
- @AutoValue
- public abstract static class Scheduling {
-
- public enum OnHostMaintenance {
- /**
- * Allows Compute Engine to automatically migrate instances out of the way of maintenance events.
- */
- MIGRATE,
- /**
- * Allows Compute Engine to terminate and restart the instance away from the maintenance activity.
- * If you would like your instance to be restarted, set the automaticRestart flag to true.
- * Your instance may be restarted more than once, and it may be restarted outside the window
- * of maintenance events.
- */
- TERMINATE
- }
-
- public abstract OnHostMaintenance onHostMaintenance();
- public abstract boolean automaticRestart();
-
- @SerializedNames({ "onHostMaintenance", "automaticRestart" })
- public static Scheduling create(OnHostMaintenance onHostMaintenance, boolean automaticRestart) {
- return new AutoValue_Instance_Scheduling(onHostMaintenance, automaticRestart);
- }
-
- Scheduling() {
- }
- }
-
- public enum Status {
- PROVISIONING,
- STAGING,
- RUNNING,
- STOPPING,
- STOPPED,
- TERMINATED
- }
-
- public abstract String id();
-
- @Nullable public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract Tags tags();
-
- public abstract URI machineType();
-
- @Nullable public abstract Status status();
-
- /** Human-readable explanation of the status. */
- @Nullable public abstract String statusMessage();
-
- /**
- * URL of the zone resource describing where this instance should be hosted; provided by the client when
- * the instance is created.
- */
- public abstract URI zone();
-
- @Nullable public abstract Boolean canIpForward();
-
- public abstract List<NetworkInterface> networkInterfaces();
-
- public abstract List<AttachedDisk> disks();
-
- public abstract Metadata metadata();
-
- public abstract List<ServiceAccount> serviceAccounts();
-
- public abstract Scheduling scheduling();
-
- @SerializedNames({ "id", "creationTimestamp", "selfLink", "name", "description", "tags", "machineType", "status", "statusMessage", "zone",
- "canIpForward", "networkInterfaces", "disks", "metadata", "serviceAccounts", "scheduling"})
- public static Instance create(String id, Date creationTimestamp, URI selfLink, String name, String description, Tags tags, URI machineType,
- Status status, String statusMessage, URI zone, Boolean canIpForward, List<NetworkInterface> networkInterfaces,
- List<AttachedDisk> disks, Metadata metadata, List<ServiceAccount> serviceAccounts, Scheduling scheduling) {
- return new AutoValue_Instance(id, creationTimestamp, selfLink, name, description, tags, machineType, status, statusMessage, zone,
- canIpForward, copyOf(networkInterfaces), copyOf(disks), metadata, copyOf(serviceAccounts), scheduling);
- }
-
- Instance() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/KeyValuePair.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/KeyValuePair.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/KeyValuePair.java
deleted file mode 100644
index 823b55e..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/KeyValuePair.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.domain;
-
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class KeyValuePair {
-
- public abstract String key();
-
- public abstract String value();
-
- @SerializedNames({ "key", "value" })
- public static KeyValuePair create(String key, String value) {
- return new AutoValue_KeyValuePair(key, value);
- }
-
- KeyValuePair(){
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/License.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/License.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/License.java
deleted file mode 100644
index 68277e5..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/License.java
+++ /dev/null
@@ -1,40 +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.domain;
-
-import java.net.URI;
-
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/** Parameter to {@linkplain org.jclouds.googlecomputeengine.features.InstanceApi#create(NewInstance)}. */
-@AutoValue
-public abstract class License {
-
- public abstract URI selfLink();
- public abstract String name();
- public abstract boolean chargesUseFee();
-
- @SerializedNames({"selfLink", "name", "chargesUseFee"})
- public static License create(URI selfLink, String name, boolean chargesUseFee) {
- return new AutoValue_License(selfLink, name, chargesUseFee);
- }
-
- License() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java
deleted file mode 100644
index cc3389d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java
+++ /dev/null
@@ -1,87 +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.domain;
-
-import static org.jclouds.googlecloud.internal.NullSafeCopies.copyOf;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/** Represents a machine type used to host an instance. */
-@AutoValue
-public abstract class MachineType {
-
- @AutoValue
- public abstract static class ScratchDisk {
-
- public abstract int diskGb();
-
- @SerializedNames({ "diskGb" })
- public static ScratchDisk create(int diskGb) {
- return new AutoValue_MachineType_ScratchDisk(diskGb);
- }
-
- ScratchDisk() {
- }
- }
-
- public abstract String id();
-
- public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- public abstract int guestCpus();
-
- public abstract int memoryMb();
-
- @Nullable public abstract Integer imageSpaceGb();
-
- public abstract List<ScratchDisk> scratchDisks();
-
- public abstract int maximumPersistentDisks();
-
- public abstract long maximumPersistentDisksSizeGb();
-
- /** The zones that this machine type can run in. */
- public abstract String zone();
-
- @Nullable public abstract Deprecated deprecated();
-
- @SerializedNames(
- { "id", "creationTimestamp", "selfLink", "name", "description", "guestCpus", "memoryMb", "imageSpaceGb", "scratchDisks", "maximumPersistentDisks",
- "maximumPersistentDisksSizeGb", "zone", "deprecated" })
- public static MachineType create(String id, Date creationTimestamp, URI selfLink, String name, String description, int guestCpus,
- int memoryMb, Integer imageSpaceGb, List<ScratchDisk> scratchDisks, int maximumPersistentDisks, long maximumPersistentDisksSizeGb,
- String zone, Deprecated deprecated) {
- return new AutoValue_MachineType(id, creationTimestamp, selfLink, name, description, guestCpus, memoryMb, imageSpaceGb, copyOf(scratchDisks),
- maximumPersistentDisks, maximumPersistentDisksSizeGb, zone, deprecated);
- }
-
- MachineType() {
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Metadata.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Metadata.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Metadata.java
deleted file mode 100644
index b512cbe..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Metadata.java
+++ /dev/null
@@ -1,118 +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.domain;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/**
- * Metadata for an instance or project, with their fingerprint.
- * <p/>
- * This object is mutable and not thread-safe.
- */
-@AutoValue
-public abstract class Metadata implements Cloneable {
-
- /** The fingerprint for the items - needed for updating them. */
- @Nullable public abstract String fingerprint();
-
- /** Adds or replaces a metadata entry. */
- public Metadata put(String key, String value) {
- remove(key);
- items().add(KeyValuePair.create(key, value));
- return this;
- }
-
- /** Adds or replaces metadata entries. */
- public Metadata putAll(Map<String, String> input) {
- for (Map.Entry<String, String> entry : input.entrySet()) {
- put(entry.getKey(), entry.getValue());
- }
- return this;
- }
-
- /** Removes any entry with the supplied key. */
- public Metadata remove(String key) {
- for (int i = 0, length = items().size(); i < length; i++) {
- if (items().get(i).key().equals(key)) {
- items().remove(i);
- return this;
- }
- }
- return this;
- }
-
- /** Copies the metadata into a new mutable map. */
- public Map<String, String> asMap() {
- Map<String, String> result = new LinkedHashMap<String, String>();
- ArrayList<KeyValuePair> items = items();
- for (int i = 0, length = items.size(); i < length; i++) {
- KeyValuePair item = items.get(i);
- result.put(item.key(), item.value());
- }
- return result;
- }
-
- /** Returns the value with the supplied key, or null. */
- @Nullable public String get(String key) {
- ArrayList<KeyValuePair> items = items();
- for (int i = 0, length = items.size(); i < length; i++) {
- KeyValuePair item = items.get(i);
- if (item.key().equals(key)) {
- return item.value();
- }
- }
- return null;
- }
-
- public boolean containsKey(String key) {
- return get(key) != null;
- }
-
- public int size() {
- return items().size();
- }
-
- /** Mutable list of metadata. */
- abstract ArrayList<KeyValuePair> items();
-
- public static Metadata create() {
- return Metadata.create(null, null);
- }
-
- public static Metadata create(String fingerprint) {
- return Metadata.create(fingerprint, null);
- }
-
- @SerializedNames({ "fingerprint", "items" })
- static Metadata create(String fingerprint, ArrayList<KeyValuePair> items) { // Dictates the type when created from json!
- return new AutoValue_Metadata(fingerprint, items != null ? items : new ArrayList<KeyValuePair>());
- }
-
- Metadata() {
- }
-
- @Override public Metadata clone() {
- return Metadata.create(fingerprint(), new ArrayList<KeyValuePair>(items()));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java
deleted file mode 100644
index 7b30cff..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.domain;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/**
- * Represents a network used to enable instance communication.
- */
-@AutoValue
-public abstract class Network {
-
- public abstract String id();
-
- public abstract Date creationTimestamp();
-
- public abstract URI selfLink();
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /**
- * The range of internal addresses that are legal on this network. This range is a CIDR
- * specification, for example: {@code 192.168.0.0/16}.
- */
- public abstract String rangeIPv4();
-
- /**
- * This must be within the range specified by IPv4Range, and is typically the first usable address in that range.
- * If not specified, the default value is the first usable address in IPv4Range.
- */
- @Nullable public abstract String gatewayIPv4();
-
- @SerializedNames({ "id", "creationTimestamp", "selfLink", "name", "description", "IPv4Range", "gatewayIPv4" })
- public static Network create(String id, Date creationTimestamp, URI selfLink, String name, String description, String rangeIPv4,
- String gatewayIPv4) {
- return new AutoValue_Network(id, creationTimestamp, selfLink, name, description, rangeIPv4, gatewayIPv4);
- }
-
- Network() {
- }
-}
[07/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiLiveTest.java
deleted file mode 100644
index 3b25b40..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiLiveTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.NewTargetInstance;
-import org.jclouds.googlecomputeengine.domain.TargetInstance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.Iterables;
-
-
-public class TargetInstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String TARGET_INSTANCE_NAME = "test-target-instance-1";
-
- @Test(groups = "live")
- public void testInsertTargetInstance(){
-
- NewTargetInstance newTargetInstance = new NewTargetInstance.Builder()
- .name(TARGET_INSTANCE_NAME)
- .description("A test Target Instance")
- .build();
-
- assertOperationDoneSuccessfully(api.targetInstancesInZone(DEFAULT_ZONE_NAME).create(newTargetInstance));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetInstance")
- public void testGetTargetInstance(){
- TargetInstance targetInstance = api.targetInstancesInZone(DEFAULT_ZONE_NAME).get(TARGET_INSTANCE_NAME);
-
- assertNotNull(targetInstance);
- assertEquals(targetInstance.name(), TARGET_INSTANCE_NAME);
- assertEquals(targetInstance.description(), "A test Target Instance");
- assertEquals(targetInstance.zone(), getZoneUrl(DEFAULT_ZONE_NAME));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetInstance", alwaysRun = true)
- public void testListTargetInstance(){
- ListPage<TargetInstance> targetInstances = api.targetInstancesInZone(DEFAULT_ZONE_NAME)
- .list(filter("name eq " + TARGET_INSTANCE_NAME)).next();
-
- assertEquals(targetInstances.size(), 1);
- assertTargetInstanceEquals(Iterables.getOnlyElement(targetInstances));
- }
-
- @Test(groups = "live", dependsOnMethods = {"testListTargetInstance", "testGetTargetInstance"}, alwaysRun = true)
- public void testDeleteTargetInstance(){
- assertOperationDoneSuccessfully(api.targetInstancesInZone(DEFAULT_ZONE_NAME).delete(TARGET_INSTANCE_NAME));
- }
-
- private void assertTargetInstanceEquals(TargetInstance targetInstance){
- assertNotNull(targetInstance);
- assertEquals(targetInstance.name(), TARGET_INSTANCE_NAME);
- assertEquals(targetInstance.description(), "A test Target Instance");
- assertEquals(targetInstance.zone(), getZoneUrl(DEFAULT_ZONE_NAME));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java
deleted file mode 100644
index 2bca642..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetInstanceApiMockTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.domain.NewTargetInstance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseTargetInstanceListTest;
-import org.jclouds.googlecomputeengine.parse.ParseTargetInstanceTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "TargetInstanceApiMockTest", singleThreaded = true)
-public class TargetInstanceApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public static String TARGET_INSTANCE_NAME = "target-instance-1";
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/target_instance_get.json"));
-
- assertEquals(targetInstanceApi().get(TARGET_INSTANCE_NAME),
- new ParseTargetInstanceTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/targetInstances/" + TARGET_INSTANCE_NAME);
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(targetInstanceApi().get(TARGET_INSTANCE_NAME));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/targetInstances/" + TARGET_INSTANCE_NAME);
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- NewTargetInstance options = new NewTargetInstance.Builder()
- .name("test-target-instance")
- .description("This is a test")
- .natPolicy("NO_NAT")
- .instance(URI.create(url("/projects/party/zones/us-central1-a/instances/instance-1")))
- .build();
-
- assertEquals(targetInstanceApi().create(options),
- new ParseOperationTest().expected(url("/projects")));
-
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/targetInstances",
- stringFromResource("/target_instance_insert.json"));
- }
-
- public void testDeleteImageResponseIs2xx() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(targetInstanceApi().delete(TARGET_INSTANCE_NAME),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/zones/us-central1-a/targetInstances/" + TARGET_INSTANCE_NAME);
- }
-
- public void delete() throws Exception {
- server.enqueue(response404());
-
- assertNull(targetInstanceApi().delete(TARGET_INSTANCE_NAME));
- assertSent(server, "DELETE", "/projects/party/zones/us-central1-a/targetInstances/" + TARGET_INSTANCE_NAME);
- }
-
- public void list() throws InterruptedException {
- server.enqueue(jsonResponse("/target_instance_list.json"));
-
- assertEquals(targetInstanceApi().list().next(), new ParseTargetInstanceListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/targetInstances");
- }
-
- public void listEmpty() throws InterruptedException {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(targetInstanceApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/targetInstances");
- }
-
- TargetInstanceApi targetInstanceApi() {
- return api().targetInstancesInZone("us-central1-a");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java
deleted file mode 100644
index b5957c2..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.HealthStatus;
-import org.jclouds.googlecomputeengine.domain.HttpHealthCheck;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.NewInstance;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule.IPProtocol;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions;
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions.SessionAffinityValue;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Iterables;
-
-public class TargetPoolApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private static final String BACKUP_TARGETPOOL_NAME = "targetpool-api-live-test-backup";
- private static final String TARGETPOOL_NAME = "targetpool-api-live-test-primary";
- private static final String THIRD_TARGETPOOL_NAME = "targetpool-apo-live-test-third";
- private static final String DESCRIPTION = "A New TargetPool!";
- private static final String DESCRIPTION_BACKUP = "A backup target pool!";
-
- private static final String INSTANCE_NETWORK_NAME = "target-pool-api-live-test-network";
- private static final String INSTANCE_NAME = "target-pool-api-live-test-instance";
- private static final String IPV4_RANGE = "10.0.0.0/8";
- private static final String HEALTHCHECK_NAME = "target-pool-test-health-check";
- private static final String FORWARDING_RULE_NAME = "target-pool-api-forwarding-rule";
-
- private List<URI> instances;
- private List<URI> httpHealthChecks;
-
- private TargetPoolApi api() {
- return api.targetPoolsInRegion(DEFAULT_REGION_NAME);
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetPool2")
- public void testCreateInstanceAndHealthCheck(){
- InstanceApi instanceApi = api.instancesInZone(DEFAULT_ZONE_NAME);
- HttpHealthCheckApi httpHealthCheckApi = api.httpHeathChecks();
-
- ListPage<Image> list = api.images().listInProject("centos-cloud", filter("name eq centos.*")).next();
- // Get an imageUri
- URI imageUri = FluentIterable.from(list)
- .filter(new Predicate<Image>() {
- @Override
- public boolean apply(Image input) {
- // filter out all deprecated images
- return !(input.deprecated() != null && input.deprecated().state() != null);
- }
- })
- .first().get().selfLink();
-
- // Insert a network.
- assertOperationDoneSuccessfully(api.networks().createInIPv4Range(INSTANCE_NETWORK_NAME,
- IPV4_RANGE));
-
- // Create an instance.
- assertOperationDoneSuccessfully(
- instanceApi.create(NewInstance.create( //
- INSTANCE_NAME, // name
- getDefaultMachineTypeUrl(), // machineType
- getNetworkUrl(INSTANCE_NETWORK_NAME), // network
- imageUri // disks
- )));
-
- Instance instance = instanceApi.get(INSTANCE_NAME);
- instances = new ArrayList<URI>();
- instances.add(instance.selfLink());
-
- // Create a healthCheck
- HttpHealthCheckCreationOptions options = new HttpHealthCheckCreationOptions.Builder()
- .checkIntervalSec(3)
- .timeoutSec(2)
- .description("A test HealthCheck for adding to targetPools")
- .buildWithDefaults();
- assertOperationDoneSuccessfully(httpHealthCheckApi.insert(HEALTHCHECK_NAME, options));
- HttpHealthCheck healthCheck = httpHealthCheckApi.get(HEALTHCHECK_NAME);
- httpHealthChecks = new ArrayList<URI>();
- httpHealthChecks.add(healthCheck.selfLink());
-
- // Create a forwarding rule
- TargetPool targetPool = api().get(TARGETPOOL_NAME);
- URI target = targetPool.selfLink();
-
- ForwardingRuleCreationOptions forwardingRuleOptions = new ForwardingRuleCreationOptions.Builder()
- .ipProtocol(IPProtocol.TCP)
- .portRange("80-80")
- .target(target)
- .build();
-
- assertOperationDoneSuccessfully(api.forwardingRulesInRegion(DEFAULT_REGION_NAME)
- .create(FORWARDING_RULE_NAME, forwardingRuleOptions));
- }
-
- @Test(groups = "live")
- public void testInsertTargetPool() {
- TargetPoolCreationOptions targetPoolCreationOptions = new TargetPoolCreationOptions.Builder(BACKUP_TARGETPOOL_NAME)
- .description(DESCRIPTION_BACKUP)
- .sessionAffinity(SessionAffinityValue.CLIENT_IP)
- .build();
- assertOperationDoneSuccessfully(api().create(targetPoolCreationOptions));
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetPool")
- public void testInsertTargetPool2(){
- TargetPool targetPool = api().get(BACKUP_TARGETPOOL_NAME);
- assertNotNull(targetPool);
- // Make a Target Pool with a backup and failoverRatio specified.
- TargetPoolCreationOptions targetPoolCreationOptions = new TargetPoolCreationOptions.Builder(TARGETPOOL_NAME)
- .description(DESCRIPTION)
- .sessionAffinity(SessionAffinityValue.CLIENT_IP)
- .backupPool(targetPool.selfLink())
- .failoverRatio((float) 0.5)
- .build();
- assertOperationDoneSuccessfully(api().create(targetPoolCreationOptions));
- TargetPool targetPool2 = api().get(TARGETPOOL_NAME);
- assertNotNull(targetPool2);
- assertEquals(targetPool2.name(), TARGETPOOL_NAME);
- assertEquals(targetPool2.description(), DESCRIPTION);
- assertEquals(targetPool2.failoverRatio(), (float) 0.5);
- assertEquals(targetPool2.backupPool(), targetPool.selfLink());
- assertEquals(targetPool2.sessionAffinity(), SessionAffinityValue.CLIENT_IP);
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetPool")
- public void testGetTargetPool() {
- TargetPool targetPool = api().get(BACKUP_TARGETPOOL_NAME);
- assertNotNull(targetPool);
- assertEquals(targetPool.name(), BACKUP_TARGETPOOL_NAME);
- assertEquals(targetPool.description(), DESCRIPTION_BACKUP);
- assertEquals(targetPool.sessionAffinity(), SessionAffinityValue.CLIENT_IP);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testInsertTargetPool", "testCreateInstanceAndHealthCheck"})
- public void testAddInstanceTargetPool() {
- assertOperationDoneSuccessfully(api().addInstance(TARGETPOOL_NAME, instances));
- TargetPool targetPool = api().get(TARGETPOOL_NAME);
- assertNotNull(targetPool);
- assertEquals(targetPool.name(), TARGETPOOL_NAME);
- assertEquals(targetPool.instances(), instances);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testInsertTargetPool2", "testCreateInstanceAndHealthCheck"})
- public void testAddHealthCheckTargetPool() {
- assertOperationDoneSuccessfully(api().addHealthCheck(TARGETPOOL_NAME, httpHealthChecks));
- TargetPool targetPool = api().get(TARGETPOOL_NAME);
- assertNotNull(targetPool);
- assertEquals(targetPool.name(), TARGETPOOL_NAME);
- assertEquals(targetPool.healthChecks(), httpHealthChecks);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testAddHealthCheckTargetPool", "testAddInstanceTargetPool"} )
- public void testGetHealthTargetPool() {
- TargetPool targetPool = api().get(TARGETPOOL_NAME);
- assertNotNull(targetPool);
- assertEquals(targetPool.instances(), instances);
- assertEquals(targetPool.healthChecks(), httpHealthChecks);
-
- HealthStatus healthStatus = api().getHealth(TARGETPOOL_NAME, instances.get(0));
- assertNotNull(healthStatus);
- assertEquals(healthStatus.healthStatus().get(0).instance(), instances.get(0));
- assertEquals(healthStatus.healthStatus().get(0).healthState(), "UNHEALTHY");
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetHealthTargetPool")
- public void testRemoveInstanceTargetPool() {
- assertOperationDoneSuccessfully(api().removeInstance(TARGETPOOL_NAME, instances));
-
- TargetPool targetPool = api().get(TARGETPOOL_NAME);
-
- assertNotNull(targetPool);
- assertEquals(targetPool.name(), TARGETPOOL_NAME);
- assertNotEquals(targetPool.instances(), instances);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetHealthTargetPool")
- public void testRemoveHealthCheckTargetPool() {
- assertOperationDoneSuccessfully(api().removeHealthCheck(TARGETPOOL_NAME, httpHealthChecks));
-
- TargetPool targetPool = api().get(TARGETPOOL_NAME);
-
- assertNotNull(targetPool);
- assertEquals(targetPool.name(), TARGETPOOL_NAME);
- assertNotEquals(targetPool.healthChecks(), httpHealthChecks);
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertTargetPool")
- public void testListTargetPool() {
- ListPage<TargetPool> targetPool = api().list(filter("name eq " + BACKUP_TARGETPOOL_NAME)).next();
- assertEquals(Iterables.size(targetPool), 1);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testInsertTargetPool2"})
- public void testListBackupTargetPool() {
- TargetPoolCreationOptions options = new TargetPoolCreationOptions.Builder(THIRD_TARGETPOOL_NAME)
- .description("A targetPool for testing setBackup.").build();
- assertOperationDoneSuccessfully(api().create(options));
- TargetPool targetPool = api().get(THIRD_TARGETPOOL_NAME);
- assertNotNull(targetPool);
- assertEquals(targetPool.name(), THIRD_TARGETPOOL_NAME);
- assertEquals(targetPool.backupPool(), null);
-
- URI selfLink = api().get(TARGETPOOL_NAME).selfLink();
-
- Float failoverRatio = Float.valueOf((float) 0.5);
- assertOperationDoneSuccessfully(api().setBackup(THIRD_TARGETPOOL_NAME, failoverRatio, selfLink));
-
- TargetPool targetPoolUpdated = api().get(THIRD_TARGETPOOL_NAME);
- assertNotNull(targetPoolUpdated);
- assertEquals(targetPoolUpdated.name(), THIRD_TARGETPOOL_NAME);
- assertEquals(targetPoolUpdated.backupPool(), selfLink);
- }
-
- @Test(groups = "live", dependsOnMethods = {"testListTargetPool",
- "testGetTargetPool",
- "testRemoveInstanceTargetPool",
- "testRemoveHealthCheckTargetPool",
- "testListBackupTargetPool"}, alwaysRun = true)
- public void testDeleteTargetPool() {
- // Note: This ordering matters due one being the backup of the other ect.
- assertOperationDoneSuccessfully(api().delete(THIRD_TARGETPOOL_NAME));
- assertOperationDoneSuccessfully(api.forwardingRulesInRegion(DEFAULT_REGION_NAME).delete(FORWARDING_RULE_NAME));
- assertOperationDoneSuccessfully(api().delete(TARGETPOOL_NAME));
- assertOperationDoneSuccessfully(api().delete(BACKUP_TARGETPOOL_NAME));
- }
-
- @AfterClass(groups = { "integration", "live" })
- public void testCleanup(){
- InstanceApi instanceApi = api.instancesInZone(DEFAULT_ZONE_NAME);
- HttpHealthCheckApi httpHealthCheckApi = api.httpHeathChecks();
-
- try {
- waitOperationDone(instanceApi.delete(INSTANCE_NAME));
- waitOperationDone(api.networks().delete(INSTANCE_NETWORK_NAME));
- waitOperationDone(httpHealthCheckApi.delete(HEALTHCHECK_NAME));
- } catch (Exception e) {
- // we don't really care about any exception here, so just delete away.
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiMockTest.java
deleted file mode 100644
index 5f579ec..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiMockTest.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions;
-import org.jclouds.googlecomputeengine.parse.ParseHealthStatusTest;
-import org.jclouds.googlecomputeengine.parse.ParseRegionOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseTargetPoolListTest;
-import org.jclouds.googlecomputeengine.parse.ParseTargetPoolTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "TargetPoolApiMockTest", singleThreaded = true)
-public class TargetPoolApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/targetpool_get.json"));
-
- assertEquals(targetPoolApi().get("test"),
- new ParseTargetPoolTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1/targetPools/test");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(targetPoolApi().get("test"));
- assertSent(server, "GET", "/projects/party/regions/us-central1/targetPools/test");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- TargetPoolCreationOptions targetPoolCreationOptions = new TargetPoolCreationOptions.Builder("test").build();
- assertEquals(targetPoolApi().create(targetPoolCreationOptions),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools",
- stringFromResource("/targetpool_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- assertEquals(targetPoolApi().delete("test-targetPool"),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/regions/us-central1/targetPools/test-targetPool");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(targetPoolApi().delete("test-targetPool"));
- assertSent(server, "DELETE", "/projects/party/regions/us-central1/targetPools/test-targetPool");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/targetpool_list.json"));
-
- assertEquals(targetPoolApi().list().next(), new ParseTargetPoolListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/regions/us-central1/targetPools");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(targetPoolApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/regions/us-central1/targetPools");
- }
-
- public void addInstance() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- List<URI> instances = ImmutableList
- .of(URI.create(url("/projects/party/zones/europe-west1-a/instances/test")));
-
- assertEquals(targetPoolApi().addInstance("test", instances),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/test/addInstance",
- stringFromResource("/targetpool_addinstance.json"));
- }
-
- public void removeInstance() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- List<URI> instances = ImmutableList
- .of(URI.create(url("/projects/party/zones/europe-west1-a/instances/test")));
-
- assertEquals(targetPoolApi().removeInstance("test", instances),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/test/removeInstance",
- stringFromResource("/targetpool_addinstance.json"));
- }
-
- public void addHealthCheck() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- List<URI> healthChecks = ImmutableList
- .of(URI.create(url("/projects/party/global/httpHealthChecks/health-check-1")));
-
- assertEquals(targetPoolApi().addHealthCheck("test", healthChecks),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/test/addHealthCheck",
- stringFromResource("/targetpool_changehealthcheck.json"));
- }
-
- public void removeHealthCheck() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- List<URI> healthChecks = ImmutableList
- .of(URI.create(url("/projects/party/global/httpHealthChecks/health-check-1")));
-
- assertEquals(targetPoolApi().removeHealthCheck("test", healthChecks),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/test/removeHealthCheck",
- stringFromResource("/targetpool_changehealthcheck.json"));
- }
-
- public void setBackup() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- URI backup = URI.create(url("/projects/party/regions/us-central1/targetPools/tpool"));
-
- assertEquals(targetPoolApi().setBackup("test", backup),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/test/setBackup",
- stringFromResource("/targetpool_setbackup.json"));
- }
-
- public void setBackup_FailoverRatio() throws Exception {
- server.enqueue(jsonResponse("/region_operation.json"));
-
- URI backup = URI.create(url("/projects/party/regions/us-central1/targetPools/tpool"));
-
- Float failoverRatio = Float.valueOf("0.5");
- assertEquals(targetPoolApi().setBackup("test", failoverRatio, backup),
- new ParseRegionOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/"
- + "test/setBackup?failoverRatio=0.5",
- stringFromResource("/targetpool_setbackup.json"));
- }
-
- public void getHealth() throws Exception {
- server.enqueue(jsonResponse("/health_status_get_health.json"));
-
- URI instance = URI.create(url("/party/zones/us-central1-a/instances/jclouds-test"));
- assertEquals(targetPoolApi().getHealth("test-pool", instance),
- new ParseHealthStatusTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/regions/us-central1/targetPools/test-pool/getHealth",
- "{\"instance\": \"" + instance.toString() + "\"}");
- }
-
- public TargetPoolApi targetPoolApi() {
- return api().targetPoolsInRegion("us-central1");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiLiveTest.java
deleted file mode 100644
index 6fa4070..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiLiveTest.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.filter;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static com.google.common.collect.ImmutableList.of;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.UrlMap;
-import org.jclouds.googlecomputeengine.domain.UrlMap.HostRule;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher.PathRule;
-import org.jclouds.googlecomputeengine.domain.UrlMap.UrlMapTest;
-import org.jclouds.googlecomputeengine.domain.UrlMapValidateResult;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.jclouds.googlecomputeengine.options.BackendServiceOptions;
-import org.jclouds.googlecomputeengine.options.UrlMapOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class UrlMapApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- public static final String URL_MAP_NAME = "url-map-api-live-test-url-map";
- public static final String URL_MAP_DEFAULT_BACKEND_SERVICE_NAME = "url-map-api-live-test-backend-service";
- public static final String URL_MAP_OTHER_BACKEND_SERVICE_NAME = "url-map-api-live-test-other-backend-service";
- public static final String HEALTH_CHECK_NAME = "url-map-api-live-test-health-check";
-
- public URI default_backend_service_url;
- public URI other_backend_service_url;
-
- private UrlMapApi api() {
- return api.urlMaps();
- }
-
- @Test(groups = "live")
- public void testInsertUrlMap() {
- // Create extra resources needed for url maps
- assertOperationDoneSuccessfully(api.httpHeathChecks().insert(HEALTH_CHECK_NAME));
-
- List<URI> healthChecks = of(getHealthCheckUrl(HEALTH_CHECK_NAME));
- BackendServiceOptions b = new BackendServiceOptions.Builder(URL_MAP_DEFAULT_BACKEND_SERVICE_NAME, healthChecks).build();
- assertOperationDoneSuccessfully(api.backendServices().create(b));
-
-
- UrlMapOptions map = new UrlMapOptions.Builder().name(URL_MAP_NAME).description("simple url map")
- .defaultService(getBackendServiceUrl(URL_MAP_DEFAULT_BACKEND_SERVICE_NAME)).build();
-
- BackendServiceOptions b2 = new BackendServiceOptions.Builder(URL_MAP_OTHER_BACKEND_SERVICE_NAME, healthChecks).build();
- assertOperationDoneSuccessfully(api.backendServices().create(b2));
-
- assertOperationDoneSuccessfully(api().create(map));
-
- default_backend_service_url = getBackendServiceUrl(URL_MAP_DEFAULT_BACKEND_SERVICE_NAME);
- other_backend_service_url = getBackendServiceUrl(URL_MAP_OTHER_BACKEND_SERVICE_NAME);
- }
-
- @Test(groups = "live", dependsOnMethods = "testInsertUrlMap")
- public void testGetUrlMap() {
-
- UrlMap urlMap = api().get(URL_MAP_NAME);
- assertNotNull(urlMap);
- assertUrlMapEquals(urlMap);
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetUrlMap")
- public void testListUrlMap() {
-
- ListPage<UrlMap> urlMaps = api().list(filter("name eq " + URL_MAP_NAME)).next();
-
- assertEquals(urlMaps.size(), 1);
-
- assertUrlMapEquals(Iterables.getOnlyElement(urlMaps));
-
- }
-
- @Test(groups = "live", dependsOnMethods = "testGetUrlMap")
- public void testUpdateUrlMap() {
- String fingerprint = api().get(URL_MAP_NAME).fingerprint();
-
- ImmutableList<String> paths = of("/other", "/other/*");
-
- ImmutableList<PathRule> rules = of(PathRule.create(paths, other_backend_service_url));
-
- ImmutableList<PathMatcher> matchers = of(
- PathMatcher.create("test-path-matcher", "", default_backend_service_url, rules));
-
- ImmutableList<HostRule> hostRules = of(
- HostRule.create("", of("*"), "test-path-matcher"));
-
- UrlMapOptions options = new UrlMapOptions.Builder().name(URL_MAP_NAME)
- .pathMatchers(matchers)
- .hostRules(hostRules)
- .defaultService(default_backend_service_url)
- .fingerprint(fingerprint).build();
-
- assertOperationDoneSuccessfully(api().update(URL_MAP_NAME, options));
-
- assertUrlMapEquals(api().get(URL_MAP_NAME), options);
- }
-
- @Test(groups = "live", dependsOnMethods = "testUpdateUrlMap")
- public void testPatchUrlMap() {
- String fingerprint = api().get(URL_MAP_NAME).fingerprint();
-
- ImmutableList<UrlMap.UrlMapTest> urlMapTests = of(
- UrlMapTest.create(null, "jclouds-test", "/test/path", default_backend_service_url),
- UrlMapTest.create(null, "jclouds-test", "/other", other_backend_service_url));
-
- UrlMapOptions options = new UrlMapOptions.Builder().tests(urlMapTests)
- .fingerprint(fingerprint).buildForPatch();
- assertOperationDoneSuccessfully(api().patch(URL_MAP_NAME, options));
-
- // Update options with settings it should have for later assertions.
- ImmutableList<String> paths = of("/other", "/other/*");
- ImmutableList<PathRule> rules = of(PathRule.create(paths, other_backend_service_url));
- ImmutableList<PathMatcher> matchers = of(
- PathMatcher.create("test-path-matcher", "", default_backend_service_url, rules));
- ImmutableList<HostRule> hostRules = of(
- HostRule.create("", of("*"), "test-path-matcher"));
-
- options = new UrlMapOptions.Builder().name(URL_MAP_NAME)
- .description("simple url map")
- .pathMatchers(matchers)
- .hostRules(hostRules)
- .defaultService(default_backend_service_url)
- .tests(urlMapTests)
- .fingerprint(fingerprint)
- .build();
-
- assertUrlMapEquals(api().get(URL_MAP_NAME), options);
- }
-
- @Test(groups = "live", dependsOnMethods = "testPatchUrlMap")
- public void testValidateUrlMap() {
- UrlMapValidateResult results = api().validate(URL_MAP_NAME, api().get(URL_MAP_NAME));
- UrlMapValidateResult expected = UrlMapValidateResult.allPass();
- assertEquals(results, expected);
- }
-
- @Test(groups = "live", dependsOnMethods = "testPatchUrlMap")
- public void testValidateUrlMapWithOptions() {
- ImmutableList<String> paths = of("/test/*");
- ImmutableList<PathRule> rules = of(PathRule.create(paths, other_backend_service_url));
-
- ImmutableList<PathMatcher> matchers = of(PathMatcher.create("test-path-matcher", "", default_backend_service_url, rules));
-
- ImmutableList<String> hosts = of("jclouds-test");
-
- ImmutableList<HostRule> hostRules = of(HostRule.create("", hosts, "test-path-matcher"));
- UrlMapTest urlMapTest = UrlMapTest.create(null, "jclouds-test", "/test/path", other_backend_service_url);
- ImmutableList<UrlMap.UrlMapTest> urlMapTests = of(urlMapTest);
-
- UrlMapOptions options = new UrlMapOptions.Builder()
- .pathMatchers(matchers)
- .name(URL_MAP_NAME)
- .hostRules(hostRules)
- .tests(urlMapTests)
- .defaultService(default_backend_service_url)
- .description("simple url map")
- .build();
-
- UrlMapValidateResult results = api().validate(URL_MAP_NAME, options);
- UrlMapValidateResult expected = UrlMapValidateResult.allPass();
-
-
- assertEquals(results, expected);
- }
-
- @Test(groups = "live", dependsOnMethods = "testValidateUrlMapWithOptions", alwaysRun = true)
- public void testDeleteUrlMap() {
-
- assertOperationDoneSuccessfully(api().delete(URL_MAP_NAME));
-
- // remove extra resources created
- assertOperationDoneSuccessfully(api.backendServices().delete(URL_MAP_DEFAULT_BACKEND_SERVICE_NAME));
- assertOperationDoneSuccessfully(api.backendServices().delete(URL_MAP_OTHER_BACKEND_SERVICE_NAME));
-
- assertOperationDoneSuccessfully(api.httpHeathChecks().delete(HEALTH_CHECK_NAME));
- }
-
- private void assertUrlMapEquals(UrlMap result) {
- assertEquals(result.name(), URL_MAP_NAME);
- assertEquals(result.defaultService(), default_backend_service_url);
- assertEquals(result.description(), "simple url map");
- }
-
- private void assertUrlMapEquals(UrlMap result, UrlMapOptions expected) {
- assertEquals(result.name(), expected.name());
- assertEquals(result.defaultService(), expected.defaultService());
- assertEquals(result.pathMatchers(), expected.pathMatchers());
- assertEquals(result.hostRules(), expected.hostRules());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
deleted file mode 100644
index 7c6d639..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/UrlMapApiMockTest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.domain.UrlMap;
-import org.jclouds.googlecomputeengine.domain.UrlMap.HostRule;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher.PathRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.options.UrlMapOptions;
-import org.jclouds.googlecomputeengine.parse.ParseOperationTest;
-import org.jclouds.googlecomputeengine.parse.ParseUrlMapListTest;
-import org.jclouds.googlecomputeengine.parse.ParseUrlMapTest;
-import org.jclouds.googlecomputeengine.parse.ParseUrlMapValidateTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-@Test(groups = "unit", testName = "UrlMapApiMockTest", singleThreaded = true)
-public class UrlMapApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/url_map_get.json"));
-
- assertEquals(urlMapApi().get("jclouds-test"), new ParseUrlMapTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/urlMaps/jclouds-test");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(urlMapApi().get("jclouds-test"));
- assertSent(server, "GET", "/projects/party/global/urlMaps/jclouds-test");
- }
-
- public void insert() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(urlMapApi().create(createBasicMap()), new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/urlMaps",
- stringFromResource("/url_map_insert.json"));
- }
-
- public void update() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(urlMapApi().update("jclouds-test", createBasicMap()),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "PUT", "/projects/party/global/urlMaps/jclouds-test",
- stringFromResource("/url_map_insert.json"));
- }
-
- public void patch() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(urlMapApi().patch("jclouds-test", createBasicMap()),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "PATCH", "/projects/party/global/urlMaps/jclouds-test",
- stringFromResource("/url_map_insert.json"));
- }
-
- public void delete() throws Exception {
- server.enqueue(jsonResponse("/operation.json"));
-
- assertEquals(urlMapApi().delete("jclouds-test"),
- new ParseOperationTest().expected(url("/projects")));
- assertSent(server, "DELETE", "/projects/party/global/urlMaps/jclouds-test");
- }
-
- public void delete_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(urlMapApi().delete("jclouds-test"));
- assertSent(server, "DELETE", "/projects/party/global/urlMaps/jclouds-test");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/url_map_list.json"));
-
- assertEquals(urlMapApi().list().next(),
- new ParseUrlMapListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/global/urlMaps");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(urlMapApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/global/urlMaps");
- }
-
- public void validate() throws Exception {
- server.enqueue(jsonResponse("/url_map_validate.json"));
-
- assertEquals(urlMapApi().validate("jclouds-test", createBasicMap()),
- new ParseUrlMapValidateTest().expected(url("/projects")));
- assertSent(server, "POST", "/projects/party/global/urlMaps/jclouds-test/validate");
- }
-
- private UrlMapOptions createBasicMap() {
- URI service = URI.create(url("/projects/myproject/global/backendServices/jclouds-test"));
- return new UrlMapOptions.Builder().name("jclouds-test")
- .description("Sample url map")
- .hostRules(ImmutableList.of(HostRule.create(null, ImmutableList.of("jclouds-test"), "path")))
- .pathMatchers(ImmutableList.of(PathMatcher.create("path",
- null,
- service,
- ImmutableList.of(
- PathRule.create(ImmutableList.of("/"),
- service)))))
- .tests(ImmutableList.of(UrlMap.UrlMapTest.create(null, "jclouds-test", "/test/path", service)))
- .defaultService(service)
- .build();
- }
-
- UrlMapApi urlMapApi() {
- return api().urlMaps();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiLiveTest.java
deleted file mode 100644
index 91c9ea1..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiLiveTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.jclouds.googlecomputeengine.options.ListOptions.Builder.maxResults;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecloud.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest;
-import org.testng.annotations.Test;
-
-public class ZoneApiLiveTest extends BaseGoogleComputeEngineApiLiveTest {
-
- private Zone zone;
-
- private ZoneApi api() {
- return api.zones();
- }
-
- @Test(groups = "live")
- public void testListZone() {
- Iterator<ListPage<Zone>> pageIterator = api().list(maxResults(1));
- assertTrue(pageIterator.hasNext());
-
- List<Zone> zoneAsList = pageIterator.next();
-
- assertEquals(zoneAsList.size(), 1);
-
- this.zone = zoneAsList.get(0);
- }
-
-
- @Test(groups = "live", dependsOnMethods = "testListZone")
- public void testGetZone() {
- Zone zone = api().get(this.zone.name());
- assertNotNull(zone);
- assertZoneEquals(zone, this.zone);
- }
-
- private void assertZoneEquals(Zone result, Zone expected) {
- assertEquals(result.name(), expected.name());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiMockTest.java
deleted file mode 100644
index cefecf4..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiMockTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.jclouds.googlecomputeengine.parse.ParseZoneListTest;
-import org.jclouds.googlecomputeengine.parse.ParseZoneTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ZoneApiMockTest", singleThreaded = true)
-public class ZoneApiMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void get() throws Exception {
- server.enqueue(jsonResponse("/zone_get.json"));
-
- assertEquals(zoneApi().get("us-central1-a"),
- new ParseZoneTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a");
- }
-
- public void get_4xx() throws Exception {
- server.enqueue(response404());
-
- assertNull(zoneApi().get("us-central1-a"));
- assertSent(server, "GET", "/projects/party/zones/us-central1-a");
- }
-
- public void list() throws Exception {
- server.enqueue(jsonResponse("/zone_list.json"));
-
- assertEquals(zoneApi().list().next(), new ParseZoneListTest().expected(url("/projects")));
- assertSent(server, "GET", "/projects/party/zones");
- }
-
- public void list_empty() throws Exception {
- server.enqueue(jsonResponse("/list_empty.json"));
-
- assertFalse(zoneApi().list().hasNext());
- assertSent(server, "GET", "/projects/party/zones");
- }
-
- ZoneApi zoneApi() {
- return api().zones();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java
deleted file mode 100644
index 1d88d5a..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.handlers;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.IArgumentMatcher;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "GoogleComputeErrorHandlerTest")
-public class GoogleComputeEngineErrorHandlerTest {
-
- @Test
- public void test409MakesIllegalStateException() {
- assertCodeMakes(
- "POST",
- URI.create("https://www.googleapis.com/compute/v1"),
- 409,
- "HTTP/1.1 409 Conflict",
- "\"{\"code\":\"InvalidState\",\"message\":\"An incompatible transition has already been queued for this" +
- " resource\"}\"",
- IllegalStateException.class);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String content,
- Class<? extends Exception> expected) {
- assertCodeMakes(method, uri, statusCode, message, "application/json", content, expected);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
- String content, Class<? extends Exception> expected) {
-
- GoogleComputeEngineErrorHandler function = new GoogleComputeEngineErrorHandler();
-
- HttpCommand command = createMock(HttpCommand.class);
- HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
- HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
- response.getPayload().getContentMetadata().setContentType(contentType);
-
- expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
- command.setException(classEq(expected));
-
- replay(command);
-
- function.handleError(command, response);
-
- verify(command);
- }
-
- public static Exception classEq(final Class<? extends Exception> in) {
- reportMatcher(new IArgumentMatcher() {
-
- @Override
- public void appendTo(StringBuffer buffer) {
- buffer.append("classEq(");
- buffer.append(in);
- buffer.append(")");
- }
-
- @Override
- public boolean matches(Object arg) {
- return arg.getClass() == in;
- }
-
- });
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java
deleted file mode 100644
index 41e1e74..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java
+++ /dev/null
@@ -1,158 +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.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.logging.Logger;
-
-import org.jclouds.apis.BaseApiLiveTest;
-import org.jclouds.googlecloud.config.CurrentProject;
-import org.jclouds.googlecloud.internal.TestProperties;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.util.concurrent.Atomics;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-
-public class BaseGoogleComputeEngineApiLiveTest extends BaseApiLiveTest<GoogleComputeEngineApi> {
-
- protected static final String ZONE_API_URL_SUFFIX = "/zones/";
- protected static final String DEFAULT_ZONE_NAME = "us-central1-f";
- protected static final String DEFAULT_REGION_NAME = "us-central1";
- protected static final String NETWORK_API_URL_SUFFIX = "/global/networks/";
- protected static final String MACHINE_TYPE_API_URL_SUFFIX = "/machineTypes/";
- protected static final String DEFAULT_MACHINE_TYPE_NAME = "n1-standard-1";
- protected static final String GATEWAY_API_URL_SUFFIX = "/global/gateways/";
- protected static final String DEFAULT_GATEWAY_NAME = "default-internet-gateway";
- protected static final String IMAGE_API_URL_SUFFIX = "/global/images/";
- protected static final String DISK_TYPE_API_URL_SUFFIX = "/diskTypes/";
-
- protected static final String BACKEND_SERVICE_API_URL_SUFFIX = "/global/backendServices/";
- protected static final String URL_MAP_API_URL_SUFFIX = "/global/urlMaps/";
- protected static final String HEALTH_CHECK_API_URL_SUFFIX = "/global/httpHealthChecks/";
- protected static final String TARGET_HTTP_PROXY_API_URL_SUFFIX = "/global/targetHttpProxies/";
- protected static final String GOOGLE_PROJECT = "google";
-
- protected Predicate<AtomicReference<Operation>> operationDone;
- protected URI projectUrl;
-
- public BaseGoogleComputeEngineApiLiveTest() {
- provider = "google-compute-engine";
- }
-
- @Override protected Properties setupProperties() {
- TestProperties.setGoogleCredentialsFromJson(provider);
- return TestProperties.apply(provider, super.setupProperties());
- }
-
- @Override protected GoogleComputeEngineApi create(Properties props, Iterable<Module> modules) {
- Injector injector = newBuilder().modules(modules).overrides(props).buildInjector();
- operationDone = injector.getInstance(Key.get(new TypeLiteral<Predicate<AtomicReference<Operation>>>() {
- }));
- projectUrl = injector.getInstance(Key.get(new TypeLiteral<Supplier<URI>>() {
- }, CurrentProject.class)).get();
- return injector.getInstance(GoogleComputeEngineApi.class);
- }
-
- protected void assertOperationDoneSuccessfully(Operation operation) {
- AtomicReference<Operation> ref = Atomics.newReference(checkNotNull(operation, "operation"));
- checkState(operationDone.apply(ref), "Timeout waiting for operation: %s", operation);
- assertEquals(ref.get().status(), Operation.Status.DONE);
- assertTrue(ref.get().error().errors().isEmpty());
- }
-
- protected void waitOperationDone(@Nullable Operation operation) {
- if (operation == null) {
- return;
- }
- if (!operationDone.apply(Atomics.newReference(operation))) {
- Logger.getAnonymousLogger().warning("Timeout waiting for operation: " + operation);
- }
- }
-
- protected URI getDiskTypeUrl(String zone, String diskType){
- return URI.create(projectUrl + ZONE_API_URL_SUFFIX + zone + DISK_TYPE_API_URL_SUFFIX + diskType);
- }
-
- protected URI getDefaultZoneUrl() {
- return getZoneUrl(DEFAULT_ZONE_NAME);
- }
-
- protected URI getZoneUrl(String zone) {
- return URI.create(projectUrl + ZONE_API_URL_SUFFIX + zone);
- }
-
- protected URI getNetworkUrl(String network) {
- return URI.create(projectUrl + NETWORK_API_URL_SUFFIX + network);
- }
-
- protected URI getGatewayUrl(String gateway) {
- return URI.create(projectUrl + GATEWAY_API_URL_SUFFIX + gateway);
- }
-
- protected URI getImageUrl(String image){
- return URI.create(projectUrl + IMAGE_API_URL_SUFFIX + image);
- }
-
- protected URI getHealthCheckUrl(String healthCheck) {
- return URI.create(projectUrl + HEALTH_CHECK_API_URL_SUFFIX + healthCheck);
- }
-
- protected URI getInstanceUrl(String instanceName) {
- return URI.create(projectUrl + ZONE_API_URL_SUFFIX + DEFAULT_ZONE_NAME + "/instances/" + instanceName);
- }
-
- protected URI getTargetHttpProxyUrl(String targetHttpProxy) {
- return URI.create(projectUrl + TARGET_HTTP_PROXY_API_URL_SUFFIX + targetHttpProxy);
- }
-
- protected URI getDefaultMachineTypeUrl() {
- return getMachineTypeUrl(DEFAULT_MACHINE_TYPE_NAME);
- }
-
- protected URI getMachineTypeUrl(String machineType) {
- return URI.create(projectUrl + ZONE_API_URL_SUFFIX
- + DEFAULT_ZONE_NAME + MACHINE_TYPE_API_URL_SUFFIX + machineType);
- }
-
- protected URI getDiskUrl(String diskName) {
- return URI.create(projectUrl + ZONE_API_URL_SUFFIX + DEFAULT_ZONE_NAME + "/disks/" + diskName);
- }
-
- protected URI getBackendServiceUrl(String backendService) {
- return URI.create(projectUrl + BACKEND_SERVICE_API_URL_SUFFIX
- + backendService);
- }
-
- protected URI getUrlMapUrl(String urlMap) {
- return URI.create(projectUrl + URL_MAP_API_URL_SUFFIX + urlMap);
- }
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
deleted file mode 100644
index 23ed532..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java
+++ /dev/null
@@ -1,147 +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.internal;
-
-import static com.google.common.base.Charsets.UTF_8;
-import static com.google.common.base.Throwables.propagate;
-import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.CREDENTIAL_TYPE;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.PROJECT_NAME;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.IMAGE_PROJECTS;
-import static org.jclouds.oauth.v2.config.CredentialType.BEARER_TOKEN_CREDENTIALS;
-import static org.jclouds.util.Strings2.toStringAndClose;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.jclouds.ContextBuilder;
-import org.jclouds.compute.ComputeService;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.concurrent.config.ExecutorServiceModule;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineProviderMetadata;
-import org.jclouds.http.okhttp.config.OkHttpCommandExecutorServiceModule;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.gson.JsonParser;
-import com.google.inject.Module;
-import com.squareup.okhttp.mockwebserver.MockResponse;
-import com.squareup.okhttp.mockwebserver.MockWebServer;
-import com.squareup.okhttp.mockwebserver.RecordedRequest;
-
-/**
- * Tests need to run {@code singleThreaded = true} as otherwise tests will clash on the server field.
- * Sharing the server field means less code to write.
- */
-public class BaseGoogleComputeEngineApiMockTest {
-
- protected final String identity = "761326798069-r5mljlln1rd4lrbhg75efgigp36m78j5@developer.gserviceaccount.com";
- protected final String credential = "1/8xbJqaOZXSUZbHLl5EOtu1pxz3fmmetKx9W8CV4t79M"; // Fake Bearer Token
-
- protected MockWebServer server;
-
- protected GoogleComputeEngineApi api() {
- return builder().buildApi(GoogleComputeEngineApi.class);
- }
-
- protected ComputeService computeService() {
- return builder().buildView(ComputeServiceContext.class).getComputeService();
- }
-
- protected ContextBuilder builder() {
- Properties overrides = new Properties();
- overrides.put(PROJECT_NAME, "party");
- overrides.put(IMAGE_PROJECTS, "debian-cloud");
- overrides.put(TIMEOUT_NODE_TERMINATED, "0"); // Avoid retry & polling in mock tests
- overrides.put(CREDENTIAL_TYPE, BEARER_TOKEN_CREDENTIALS.toString());
- return ContextBuilder.newBuilder(new GoogleComputeEngineProviderMetadata())
- .credentials(identity, credential)
- .endpoint(url(""))
- .overrides(overrides)
- .modules(modules);
- }
-
- private final Set<Module> modules = ImmutableSet
- .of(new ExecutorServiceModule(sameThreadExecutor()), GoogleComputeEngineTestModule.INSTANCE, new OkHttpCommandExecutorServiceModule());
-
- final AtomicInteger suffix = new AtomicInteger();
-
- @BeforeMethod
- public void start() throws IOException {
- suffix.set(0);
- server = new MockWebServer();
- server.play();
- }
-
- protected String url(String path) {
- return server.getUrl(path).toString();
- }
-
- @AfterMethod(alwaysRun = true)
- public void stop() throws IOException {
- server.shutdown();
- }
-
- protected MockResponse jsonResponse(String resource) {
- return new MockResponse().addHeader("Content-Type", "application/json").setBody(stringFromResource(resource));
- }
-
- protected MockResponse response404(){
- return new MockResponse().setStatus("HTTP/1.1 404 Not Found");
- }
-
- protected String stringFromResource(String resourceName) {
- try {
- return toStringAndClose(getClass().getResourceAsStream(resourceName))
- .replace("https://www.googleapis.com/compute/v1/", url("/"));
- } catch (IOException e) {
- throw propagate(e);
- }
- }
-
- protected MockResponse singleRegionSingleZoneResponse() {
- return new MockResponse().setBody("{\"items\":[" + stringFromResource("/region_get.json")
- .replace("\"" + url("/") + "projects/party/zones/us-central1-b\"", "") + "]}");
- }
-
- protected RecordedRequest assertSent(MockWebServer server, String method, String path) throws InterruptedException {
- RecordedRequest request = server.takeRequest();
- assertEquals(request.getMethod(), method);
- assertEquals(request.getPath(), path);
- assertEquals(request.getHeader("Accept"), APPLICATION_JSON);
- assertEquals(request.getHeader("Authorization"), "Bearer " + credential);
- return request;
- }
-
- protected RecordedRequest assertSent(MockWebServer server, String method, String path, String json)
- throws InterruptedException {
- RecordedRequest request = assertSent(server, method, path);
- assertEquals(request.getHeader("Content-Type"), APPLICATION_JSON);
- assertEquals(parser.parse(new String(request.getBody(), UTF_8)), parser.parse(json));
- return request;
- }
-
- /** So that we can ignore formatting. */
- private final JsonParser parser = new JsonParser();
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java
deleted file mode 100644
index 59b5e1f..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java
+++ /dev/null
@@ -1,122 +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.internal;
-
-import static com.google.common.base.Charsets.UTF_8;
-import static com.google.common.base.Throwables.propagate;
-import static com.google.common.io.BaseEncoding.base64Url;
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecloud.config.GoogleCloudProperties.PROJECT_NAME;
-import static org.jclouds.oauth.v2.config.OAuthProperties.JWS_ALG;
-import static org.jclouds.util.Strings2.toStringAndClose;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineProviderMetadata;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.io.Payload;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-import com.google.common.base.Joiner;
-import com.google.inject.Module;
-
-public class BaseGoogleComputeEngineExpectTest<T> extends BaseRestApiExpectTest<T> {
- protected static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute";
- protected static final String COMPUTE_READONLY_SCOPE = "https://www.googleapis.com/auth/compute.readonly";
- protected static final String BASE_URL = "https://www.googleapis.com/compute/v1/projects";
-
- private static final String header = "{\"alg\":\"none\",\"typ\":\"JWT\"}";
-
- private static final String CLAIMS_TEMPLATE = "{" +
- "\"iss\":\"%s\"," +
- "\"scope\":\"%s\"," +
- "\"aud\":\"https://accounts.google.com/o/oauth2/token\"," +
- "\"exp\":3600," +
- "\"iat\":0}";
-
- protected static final String TOKEN = "1/8xbJqaOZXSUZbHLl5EOtu1pxz3fmmetKx9W8CV4t79M";
-
- protected static final HttpResponse TOKEN_RESPONSE = HttpResponse.builder().statusCode(200).payload(
- payloadFromString("{\n" +
- " \"access_token\" : \"" + TOKEN + "\",\n" +
- " \"token_type\" : \"Bearer\",\n" +
- " \"expires_in\" : 3600\n" +
- "}")).build();
-
- protected BaseGoogleComputeEngineExpectTest() {
- provider = "google-compute-engine";
- identity = "761326798069-r5mljlln1rd4lrbhg75efgigp36m78j5@developer.gserviceaccount.com";
- }
-
- @Override protected ProviderMetadata createProviderMetadata(){
- return new GoogleComputeEngineProviderMetadata();
- }
-
- @Override protected Module createModule() {
- return GoogleComputeEngineTestModule.INSTANCE;
- }
-
- @Override
- protected Properties setupProperties() {
- Properties props = super.setupProperties();
- props.put(PROJECT_NAME, "party");
- // use no sig algorithm for expect tests (means no credential is required either)
- props.put(JWS_ALG, "none");
- return props;
- }
-
- @Override
- protected HttpRequestComparisonType compareHttpRequestAsType(HttpRequest input) {
- HttpRequestComparisonType reqType = HttpRequestComparisonType.DEFAULT;
- if (input.getPayload() != null) {
- if (input.getPayload().getContentMetadata().getContentType().equals(APPLICATION_JSON)) {
- reqType = HttpRequestComparisonType.JSON;
- }
- }
- return reqType;
- }
-
- protected HttpRequest requestForScopes(String... scopes) {
- String claims = String.format(CLAIMS_TEMPLATE, identity, Joiner.on(",").join(scopes));
-
- String payload = "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&" +
- // Base64 Encoded Header
- "assertion=" + base64Url().omitPadding().encode(header.getBytes(UTF_8)) + "." +
- // Base64 Encoded Claims
- base64Url().omitPadding().encode(claims.getBytes(UTF_8)) + ".";
-
- return HttpRequest.builder()
- .method("POST")
- .endpoint(URI.create("https://accounts.google.com/o/oauth2/token"))
- .addHeader("Accept", APPLICATION_JSON)
- .payload(payloadFromStringWithContentType(payload, "application/x-www-form-urlencoded"))
- .build();
- }
-
- protected static Payload staticPayloadFromResource(String resource) {
- try {
- return payloadFromString(
- toStringAndClose(BaseGoogleComputeEngineExpectTest.class.getResourceAsStream(resource)));
- } catch (IOException e) {
- throw propagate(e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineParseTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineParseTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineParseTest.java
deleted file mode 100644
index 5e90a0a..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineParseTest.java
+++ /dev/null
@@ -1,41 +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.internal;
-
-import java.util.Date;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.googlecomputeengine.config.GoogleComputeEngineParserModule;
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.json.config.GsonModule;
-
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-
-public abstract class BaseGoogleComputeEngineParseTest<T> extends BaseItemParserTest<T> {
-
- protected static final String BASE_URL = "https://www.googleapis.com/compute/v1/projects";
-
- @Override
- protected Injector injector() {
- return Guice.createInjector(new GsonModule(), new GoogleComputeEngineParserModule());
- }
-
- protected static Date parse(String iso8601) {
- return new SimpleDateFormatDateService().iso8601DateParse(iso8601);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/GoogleComputeEngineTestModule.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/GoogleComputeEngineTestModule.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/GoogleComputeEngineTestModule.java
deleted file mode 100644
index 8d492ec..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/GoogleComputeEngineTestModule.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.internal;
-
-import static com.google.common.base.Charsets.UTF_8;
-import static com.google.common.base.Throwables.propagate;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.jclouds.crypto.Pems.privateKeySpec;
-import static org.jclouds.crypto.Pems.publicKeySpec;
-import static org.jclouds.crypto.PemsTest.PRIVATE_KEY;
-import static org.jclouds.crypto.PemsTest.PUBLIC_KEY;
-
-import java.security.KeyFactory;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.SecureRandom;
-import java.security.interfaces.RSAPublicKey;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.jclouds.crypto.Crypto;
-import org.jclouds.oauth.v2.filters.JWTBearerTokenFlow;
-import org.jclouds.ssh.SshKeys;
-
-import com.google.common.base.Supplier;
-import com.google.common.io.ByteSource;
-import com.google.inject.Binder;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-
-enum GoogleComputeEngineTestModule implements Module {
- INSTANCE;
-
- private final KeyPair keyPair;
- final String openSshKey;
-
- GoogleComputeEngineTestModule() {
- try {
- KeyFactory keyfactory = KeyFactory.getInstance("RSA");
- PrivateKey privateKey = keyfactory
- .generatePrivate(privateKeySpec(ByteSource.wrap(PRIVATE_KEY.getBytes(UTF_8))));
- PublicKey publicKey = keyfactory.generatePublic(publicKeySpec(ByteSource.wrap(PUBLIC_KEY.getBytes(UTF_8))));
- keyPair = new KeyPair(publicKey, privateKey);
- openSshKey = SshKeys.encodeAsOpenSSH(RSAPublicKey.class.cast(publicKey));
- } catch (Exception e) {
- throw propagate(e);
- }
- }
-
- @Override public void configure(Binder binder) {
- // Predictable time
- binder.bind(JWTBearerTokenFlow.class).to(JWTBearerTokenFlow.TestJWTBearerTokenFlow.class);
-
- // Predictable ssh keys
- Crypto crypto = createMock(Crypto.class);
- KeyPairGenerator rsaKeyPairGenerator = createMock(KeyPairGenerator.class);
- SecureRandom secureRandom = createMock(SecureRandom.class);
- expect(crypto.rsaKeyPairGenerator()).andReturn(rsaKeyPairGenerator).anyTimes();
- rsaKeyPairGenerator.initialize(2048, secureRandom);
- expectLastCall().anyTimes();
- expect(rsaKeyPairGenerator.genKeyPair()).andReturn(keyPair).anyTimes();
- replay(crypto, rsaKeyPairGenerator, secureRandom);
- binder.bind(Crypto.class).toInstance(crypto);
- binder.bind(SecureRandom.class).toInstance(secureRandom);
-
- // predictable node names
- final AtomicInteger suffix = new AtomicInteger();
- binder.bind(new TypeLiteral<Supplier<String>>() {
- }).toInstance(new Supplier<String>() {
- @Override
- public String get() {
- return suffix.getAndIncrement() + "";
- }
- });
- }
-}
[11/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ForwardingRuleCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ForwardingRuleCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ForwardingRuleCreationOptions.java
deleted file mode 100644
index 7391e83..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ForwardingRuleCreationOptions.java
+++ /dev/null
@@ -1,109 +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.options;
-
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/**
- * Options for creating a Forwarding Rule
- */
-@AutoValue
-public abstract class ForwardingRuleCreationOptions{
-
- @Nullable public abstract String description();
- @Nullable public abstract String ipAddress();
- @Nullable public abstract ForwardingRule.IPProtocol ipProtocol();
- @Nullable public abstract String portRange();
- @Nullable public abstract URI target();
-
-
- @SerializedNames({"description", "ipAddress", "ipProtocol", "portRange", "target"})
- static ForwardingRuleCreationOptions create(
- String description, String ipAddress, ForwardingRule.IPProtocol ipProtocol,
- String portRange, URI target){
- return new AutoValue_ForwardingRuleCreationOptions(description, ipAddress, ipProtocol, portRange, target);
- }
-
- ForwardingRuleCreationOptions(){
- }
-
- public static class Builder {
-
- private String description;
- private String ipAddress;
- private ForwardingRule.IPProtocol ipProtocol;
- private String portRange;
- private URI target;
-
- /**
- * An optional textual description of the TargetPool.
- * @return description, provided by the client.
- */
- public Builder description(String description){
- this.description = description;
- return this;
- }
-
- /**
- * The external IP address that this forwarding rule is serving on behalf of
- * @return ipAddress
- */
- public Builder ipAddress(String ipAddress){
- this.ipAddress = ipAddress;
- return this;
- }
-
- /**
- * The IP protocol to which this rule applies
- * @return ipProtocol
- */
- public Builder ipProtocol(ForwardingRule.IPProtocol ipProtocol){
- this.ipProtocol = ipProtocol;
- return this;
- }
-
- /**
- * If IPProtocol is TCP or UDP, packets addressed to ports in the specified range
- * will be forwarded to backend. By default, this is empty and all ports are allowed.
- * @return portRange
- */
- public Builder portRange(String portRange){
- this.portRange = portRange;
- return this;
- }
-
- /**
- * The URL of the target resource to receive the matched traffic.
- * The target resource must live in the same region as this forwarding rule.
- * @return target
- */
- public Builder target(URI target){
- this.target = target;
- return this;
- }
-
- public ForwardingRuleCreationOptions build() {
- return create(description, ipAddress, ipProtocol, portRange, target);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/HttpHealthCheckCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/HttpHealthCheckCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/HttpHealthCheckCreationOptions.java
deleted file mode 100644
index 6902232..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/HttpHealthCheckCreationOptions.java
+++ /dev/null
@@ -1,169 +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.options;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class HttpHealthCheckCreationOptions {
-
- @Nullable public abstract String host();
- @Nullable public abstract String requestPath();
- @Nullable public abstract Integer port();
- @Nullable public abstract Integer checkIntervalSec();
- @Nullable public abstract Integer timeoutSec();
- @Nullable public abstract Integer unhealthyThreshold();
- @Nullable public abstract Integer healthyThreshold();
- @Nullable public abstract String description();
-
- static final String DEFAULT_REQUEST_PATH = "/";
- static final int DEFAULT_PORT = 80;
- static final int DEFAULT_CHECK_INTERVAL_SEC = 5;
- static final int DEFAULT_TIMEOUT_SEC = 5;
- static final int DEFAULT_UNHEALTHY_THRESHOLD = 2;
- static final int DEFAULT_HEALTHY_THRESHOLD = 2;
-
- /*
- * Currently GCE is not setting the advertised defaults so we do so here.
- * This only leads to trouble in the case of a PATCH operation which we now
- * have a workaround for.
- */
- /**
- * @param requestPath Defaults to {@value #DEFAULT_REQUEST_PATH} when null.
- * @param port Defaults to {@value #DEFAULT_PORT} when null.
- * @param checkIntervalSec Defaults to {@value #DEFAULT_CHECK_INTERVAL_SEC} when null.
- * @param timeoutSec Defaults to {@value #DEFAULT_TIMEOUT_SEC} when null.
- * @param unhealthyThreshold Defaults to {@value #DEFAULT_UNHEALTHY_THRESHOLD} when null.
- * @param healthyThreshold Defaults to {@value #DEFAULT_HEALTHY_THRESHOLD} when null.
- */
- static HttpHealthCheckCreationOptions createWithDefaults(String host,
- String requestPath, Integer port, Integer checkIntervalSec, Integer timeoutSec, Integer unhealthyThreshold,
- Integer healthyThreshold, String description) {
- return create(host, requestPath != null ? requestPath : DEFAULT_REQUEST_PATH, port != null ? port : DEFAULT_PORT,
- checkIntervalSec != null ? checkIntervalSec : DEFAULT_CHECK_INTERVAL_SEC,
- timeoutSec != null ? timeoutSec : DEFAULT_TIMEOUT_SEC,
- unhealthyThreshold != null ? unhealthyThreshold : DEFAULT_UNHEALTHY_THRESHOLD,
- healthyThreshold != null ? healthyThreshold : DEFAULT_HEALTHY_THRESHOLD, description);
- }
-
- @SerializedNames(
- { "host", "requestPath", "port", "checkIntervalSec", "timeoutSec",
- "unhealthyThreshold", "healthyThreshold", "description"})
- static HttpHealthCheckCreationOptions create(String host, String requestPath, Integer port,
- Integer checkIntervalSec, Integer timeoutSec, Integer unhealthyThreshold,
- Integer healthyThreshold, String description) {
- return new AutoValue_HttpHealthCheckCreationOptions(host, requestPath, port,
- checkIntervalSec, timeoutSec, unhealthyThreshold, healthyThreshold, description);
- }
-
- HttpHealthCheckCreationOptions() {
- }
-
- public static class Builder {
-
- private String host;
- private String requestPath;
- private Integer port;
- private Integer checkIntervalSec;
- private Integer timeoutSec;
- private Integer unhealthyThreshold;
- private Integer healthyThreshold;
- private String description;
-
-
- /** The value of the host header in the HTTP health check request. */
- public Builder host(String host){
- this.host = host;
- return this;
- }
-
- /** The request path of the HTTP health check request. The default value is {@value #DEFAULT_REQUEST_PATH}. */
- public Builder requestPath(String requestPath){
- this.requestPath = requestPath;
- return this;
- }
-
- /** The TCP port number for the HTTP health check request. The default value is {@value #DEFAULT_PORT}. */
- public Builder port(Integer port){
- this.port = port;
- return this;
- }
-
- /** How often (in seconds) to send a health check. The default value is {@value #DEFAULT_CHECK_INTERVAL_SEC} seconds. */
- public Builder checkIntervalSec(Integer checkIntervalSec){
- this.checkIntervalSec = checkIntervalSec;
- return this;
- }
-
- /** How long (in seconds) to wait before claiming failure. The default value is {@value #DEFAULT_TIMEOUT_SEC} seconds. */
- public Builder timeoutSec(Integer timeoutSec){
- this.timeoutSec = timeoutSec;
- return this;
- }
-
- /**
- * A so-far healthy VM will be marked unhealthy after this many consecutive failures.
- * The default value is {@value #DEFAULT_UNHEALTHY_THRESHOLD}.
- */
- public Builder unhealthyThreshold(Integer unhealthyThreshold){
- this.unhealthyThreshold = unhealthyThreshold;
- return this;
- }
-
- /**
- * An unhealthy VM will be marked healthy after this many consecutive successes.
- * The default value is {@value #DEFAULT_HEALTHY_THRESHOLD}.
- */
- public Builder healthyThreshold(Integer healthyThreshold){
- this.healthyThreshold = healthyThreshold;
- return this;
- }
-
- /** An optional textual description of the TargetPool. */
- public Builder description(String description){
- this.description = description;
- return this;
- }
-
- /**
- * Fields left as null will be replaced with their default before the request
- * is made.
- * @param requestPath Defaults to {@value #DEFAULT_REQUEST_PATH} when null.
- * @param port Defaults to {@value #DEFAULT_PORT} when null.
- * @param checkIntervalSec Defaults to {@value #DEFAULT_CHECK_INTERVAL_SEC} when null.
- * @param timeoutSec Defaults to {@value #DEFAULT_TIMEOUT_SEC} when null.
- * @param unhealthyThreshold Defaults to {@value #DEFAULT_UNHEALTHY_THRESHOLD} when null.
- * @param healthyThreshold Defaults to {@value #DEFAULT_HEALTHY_THRESHOLD} when null.
- */
- public HttpHealthCheckCreationOptions buildWithDefaults() {
- return HttpHealthCheckCreationOptions.createWithDefaults(host, requestPath, port,
- checkIntervalSec, timeoutSec, unhealthyThreshold, healthyThreshold, description);
- }
-
- /**
- * Useful when performing a PATCH operation and you do not want to overwrite
- * unspecified values with the default values.
- */
- public HttpHealthCheckCreationOptions buildForPatch() {
- return HttpHealthCheckCreationOptions.create(host, requestPath, port,
- checkIntervalSec, timeoutSec, unhealthyThreshold, healthyThreshold, description);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ImageCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ImageCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ImageCreationOptions.java
deleted file mode 100644
index 0a33ada..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ImageCreationOptions.java
+++ /dev/null
@@ -1,87 +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.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.googlecomputeengine.domain.Image.RawDisk;
-import org.jclouds.googlecomputeengine.domain.NewTargetInstance.Builder;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-import org.jclouds.googlecomputeengine.domain.Deprecated;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class ImageCreationOptions {
-
- public abstract String name();
- @Nullable public abstract String description();
- @Nullable public abstract String sourceType();
- @Nullable public abstract RawDisk rawDisk();
- @Nullable public abstract Deprecated deprecated();
- @Nullable public abstract String sourceDisk();
-
- @SerializedNames({"name", "description", "sourceType", "rawDisk", "deprecated", "sourceDisk"})
- static ImageCreationOptions create(String name, String description, String sourceType,
- RawDisk rawDisk, Deprecated deprecated, String sourceDisk){
- return new AutoValue_ImageCreationOptions(name, description, sourceType, rawDisk, deprecated, sourceDisk);
- }
-
- public static class Builder {
- public String name;
- public String description;
- public String sourceType;
- public RawDisk rawDisk;
- public Deprecated deprecated;
- public String sourceDisk;
-
- public Builder(String name) {
- this.name = name;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder sourceType(String sourceType) {
- this.sourceType = sourceType;
- return this;
- }
-
- public Builder rawDisk(RawDisk rawDisk) {
- this.rawDisk = rawDisk;
- return this;
- }
-
- public Builder deprecated(Deprecated deprecated) {
- this.deprecated = deprecated;
- return this;
- }
-
- public Builder sourceDisk(String sourceDisk) {
- this.sourceDisk = sourceDisk;
- return this;
- }
-
- public ImageCreationOptions build() {
- checkNotNull(name, "ImageCreationOptions: name cannot be null");
- return create(name, description, sourceType, rawDisk, deprecated, sourceDisk);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java
deleted file mode 100644
index 314f157..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Allows to optionally specify a filter, max results and a page token for <code>listPage</code> REST methods.
- */
-public final class ListOptions extends org.jclouds.googlecloud.options.ListOptions {
-
- /**
- * Optional. Filter expression for filtering listed resources, in the form filter={expression}. Your {expression}
- * must contain the following:
- * <p/>
- * {@code <field_name> <comparison_string> <literal_string>}
- * <ul>
- * <li>{@code <field_name>}: The name of the field you want to compare. The field name must be valid for the
- * type of resource being filtered. Only atomic field types are supported (string, number,
- * boolean). Array and object fields are not currently supported.</li>
- * <li>{@code <comparison_string>}: The comparison string, either eq (equals) or ne (not equals).</li>
- * <li>{@code <literal_string>}: The literal string value to filter to. The literal value must be valid
- * for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a
- * regular expression using RE2 syntax. The literal value must match the entire field. For example,
- * when filtering instances, name eq my_instance won't work, but name eq .*my_instance will work.</li>
- * </ul>
- * <p/>
- * For example:
- * <p/>
- * {@code filter=status ne RUNNING}
- * <p/>
- * The above filter returns only results whose status field does not equal RUNNING. You can also enclose your
- * literal string in single, double, or no quotes. For example, all three of the following would be valid
- * expressions:
- * <p/>
- * {@code filter=status ne "RUNNING"}<br/>
- * {@code filter=status ne 'RUNNING'}<br/>
- * {@code filter=status ne RUNNING}<br/>
- * <p/>
- * Complex regular expressions can also be used, like the following:
- * {@code name eq '."my_instance_[0-9]+'}
- */
- public ListOptions filter(String filter) {
- this.queryParameters.put("filter", checkNotNull(filter, "filter"));
- return this;
- }
-
- /**
- * Sets Maximum count of results to be returned. Maximum and default value is 100. Acceptable items are 0 to
- * 100, inclusive. (Default: 100)
- */
- @Override public ListOptions maxResults(Integer maxResults) {
- return (ListOptions) super.maxResults(maxResults);
- }
-
- public static final class Builder {
-
- /**
- * @see ListOptions#filter(String)
- */
- public static ListOptions filter(String filter) {
- return new ListOptions().filter(filter);
- }
-
- /**
- * @see ListOptions#maxResults(Integer)
- */
- public static ListOptions maxResults(Integer maxResults) {
- return new ListOptions().maxResults(maxResults);
- }
-
- private Builder(){
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/NetworkCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/NetworkCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/NetworkCreationOptions.java
deleted file mode 100644
index 3003322..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/NetworkCreationOptions.java
+++ /dev/null
@@ -1,85 +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.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/**
- * Represents a network used to enable instance communication.
- */
-@AutoValue
-public abstract class NetworkCreationOptions {
-
- public abstract String name();
-
- @Nullable public abstract String description();
-
- /**
- * The range of internal addresses that are legal on this network. This range is a CIDR
- * specification, for example: {@code 192.168.0.0/16}.
- */
- public abstract String rangeIPv4();
-
- /**
- * This must be within the range specified by IPv4Range, and is typically the first usable address in that range.
- * If not specified, the default value is the first usable address in IPv4Range.
- */
- @Nullable public abstract String gatewayIPv4();
-
- @SerializedNames({ "name", "description", "IPv4Range", "gatewayIPv4" })
- public static NetworkCreationOptions create(String name, String description, String rangeIPv4,
- String gatewayIPv4) {
- return new AutoValue_NetworkCreationOptions(name, description, rangeIPv4, gatewayIPv4);
- }
-
- NetworkCreationOptions() {
- }
-
- public static class Builder {
- private String name;
- private String description;
- private String rangeIPv4;
- private String gatewayIPv4;
-
- public Builder(String name, String rangeIPv4){
- this.name = name;
- this.rangeIPv4 = rangeIPv4;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder gatewayIPv4(String gatewayIPv4) {
- this.gatewayIPv4 = gatewayIPv4;
- return this;
- }
-
- public NetworkCreationOptions build() {
- checkNotNull(name, "NetworkCreationOptions name cannot be null");
- checkNotNull(rangeIPv4, "NetworkCreationOptions rangeIPv4 cannot be null");
- return create(name, description, rangeIPv4, gatewayIPv4);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java
deleted file mode 100644
index 6661fcd..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/RouteOptions.java
+++ /dev/null
@@ -1,218 +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.options;
-
-import java.net.URI;
-import java.util.List;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * Options to insert a route.
- *
- * @see org.jclouds.googlecomputeengine.domain.Route
- */
-public class RouteOptions {
-
- private String name;
- private URI network;
- private String destRange;
- private URI nextHopInstance;
- private String nextHopIp;
- private URI nextHopNetwork;
- private URI nextHopGateway;
- private String description;
- private Integer priority;
- private URI nextHopVpnTunnel;
-
- private ImmutableList.Builder<String> tags = ImmutableList.builder();
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#name()
- */
- public String name() {
- return name;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#name()
- */
- public RouteOptions name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDescription()
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDescription()
- */
- public RouteOptions description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDestRange()
- */
- public String getDestRange() {
- return destRange;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getDestRange()
- */
- public RouteOptions destRange(String destRange) {
- this.destRange = destRange;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopIp()
- */
- public String getNextHopIp() {
- return nextHopIp;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopIp()
- */
- public RouteOptions nextHopIp(String nextHopIp) {
- this.nextHopIp = nextHopIp;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getPriority()
- */
- public Integer getPriority() {
- return priority;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getPriority()
- */
- public RouteOptions priority(Integer priority) {
- this.priority = priority;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopVpnTunnel()
- */
- public RouteOptions nextHopVpnTunnel(URI nextHopVpnTunnel){
- this.nextHopVpnTunnel = nextHopVpnTunnel;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNetwork()
- */
- public RouteOptions network(URI network) {
- this.network = network;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNetwork()
- */
- public URI getNetwork() {
- return network;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopInstance()
- */
- public RouteOptions nextHopInstance(URI nextHopInstance) {
- this.nextHopInstance = nextHopInstance;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopInstance()
- */
- public URI getNextHopInstance() {
- return nextHopInstance;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopNetwork()
- */
- public RouteOptions nextHopNetwork(URI nextHopNetwork) {
- this.nextHopNetwork = nextHopNetwork;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopNetwork()
- */
- public URI getNextHopNetwork() {
- return nextHopNetwork;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopGateway()
- */
- public RouteOptions nextHopGateway(URI nextHopGateway) {
- this.nextHopGateway = nextHopGateway;
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopGateway()
- */
- public URI getNextHopGateway() {
- return nextHopGateway;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getNextHopVpnTunnel()
- */
- public URI getNextHopVpnTunnel() {
- return nextHopVpnTunnel;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getTags()
- */
- public List<String> getTags() {
- return tags.build();
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getTags()
- */
- public RouteOptions addTag(String tag) {
- this.tags.add(tag);
- return this;
- }
-
- /**
- * @see org.jclouds.googlecomputeengine.domain.Route#getTags()
- */
- public RouteOptions tags(List<String> tags) {
- this.tags = ImmutableList.builder();
- this.tags.addAll(tags);
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetHttpProxyOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetHttpProxyOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetHttpProxyOptions.java
deleted file mode 100644
index 0fa01c9..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetHttpProxyOptions.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class TargetHttpProxyOptions {
-
- public abstract String name();
- @Nullable public abstract String description();
- public abstract URI urlMap();
-
- @SerializedNames({ "name", "description", "urlMap"})
- static TargetHttpProxyOptions create(String name, String description, URI urlMap) {
- return new AutoValue_TargetHttpProxyOptions(name, description, urlMap);
- }
-
- TargetHttpProxyOptions() {
- }
-
- public static class Builder {
- private String name;
- private String description;
- private URI urlMap;
-
- public Builder(String name, URI urlMap) {
- this.name = name;
- this.urlMap = urlMap;
- }
-
- /**
- * @see TargetHttpProxyOptions#getDescription()
- */
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public TargetHttpProxyOptions build() {
- checkNotNull(name, "TargetHttpProxyOptions name cannot be null");
- checkNotNull(urlMap, "TargetHttpProxyOptions name cannot be null");
- return create(name, description, urlMap);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetPoolCreationOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetPoolCreationOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetPoolCreationOptions.java
deleted file mode 100644
index 31ba738..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/TargetPoolCreationOptions.java
+++ /dev/null
@@ -1,142 +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.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-/**
- * Options for creating a Target Pool
- */
-@AutoValue
-public abstract class TargetPoolCreationOptions{
-
- /**
- * Session affinity determines the hash method that
- * Google Compute Engine uses to distribute traffic.
- * @see <a href="https://cloud.google.com/compute/docs/reference/latest/targetPools#resource"/>
- */
- public enum SessionAffinityValue {
- CLIENT_IP,
- CLIENT_IP_PROTO,
- NONE
- }
-
- public abstract String name();
- @Nullable public abstract List<URI> healthChecks();
- @Nullable public abstract List<URI> instances();
- @Nullable public abstract SessionAffinityValue sessionAffinity();
- @Nullable public abstract Float failoverRatio();
- @Nullable public abstract URI backupPool();
- @Nullable public abstract String description();
-
- @SerializedNames({ "name", "healthChecks", "instances", "sessionAffinity", "failoverRatio",
- "backupPool", "description"})
- public static TargetPoolCreationOptions create(String name, List<URI> healthChecks, List<URI> instances,
- SessionAffinityValue sessionAffinity, Float failoverRatio, URI backupPool, String description) {
- return new AutoValue_TargetPoolCreationOptions(name, healthChecks, instances, sessionAffinity, failoverRatio,
- backupPool, description);
- }
-
- TargetPoolCreationOptions() {
- }
-
- public static class Builder {
-
- private String name;
- private List<URI> healthChecks;
- private List<URI> instances;
- private SessionAffinityValue sessionAffinity;
- private Float failoverRatio;
- private URI backupPool;
- private String description;
-
- public Builder(String name){
- checkNotNull(name, "TargetPoolCreationOptions name cannot be null");
- this.name = name;
- }
-
- /** The set of HealthChecks */
- public Builder healthChecks(List<URI> healthChecks){
- this.healthChecks = healthChecks;
- return this;
- }
-
- /**
- * A List of resource URIs to the member VMs serving this pool.
- * They must live in zones contained in the same region as this pool.
- */
- public Builder instances(List<URI> instances){
- this.instances = instances;
- return this;
- }
-
- /**
- * Defines the session affinity option.
- * Session affinity determines the hash method that Google Compute Engine uses to distribute traffic.
- */
- public Builder sessionAffinity(SessionAffinityValue sessionAffinity){
- this.sessionAffinity = sessionAffinity;
- return this;
- }
-
- /**
- * This field is applicable only when the target pool is serving a forwarding rule as the primary pool
- * (e.g. not as a backup pool to some other target pool).
- * The value of the a float between [0, 1].
- * If set, backupPool must also be set.
- * @return failoverRatio, a float between [0, 1]
- */
- public Builder failoverRatio(float failoverRatio){
- this.failoverRatio = failoverRatio;
- return this;
- }
-
- /**
- * This field is applicable only when the target pool is serving a forwarding rule as the primary pool
- * (e.g. not as a backup pool to some other target pool). Must be a fully-qualified URL to a target pool
- * that is in the same region as the primary target pool.
- * If set, failoverRatio must also be set
- * @return backupPool, Fully-qualified URI to a target pool in the same region as primary target pool
- */
- public Builder backupPool(URI backupPool){
- this.backupPool = backupPool;
- return this;
- }
-
- /**
- * An optional textual description of the TargetPool.
- * @return description, provided by the client.
- */
- public Builder description(String description){
- this.description = description;
- return this;
- }
-
- public TargetPoolCreationOptions build() {
- return create(name, healthChecks, instances, sessionAffinity, failoverRatio,
- backupPool, description);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/UrlMapOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/UrlMapOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/UrlMapOptions.java
deleted file mode 100644
index e569e79..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/UrlMapOptions.java
+++ /dev/null
@@ -1,145 +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.options;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.UrlMap.HostRule;
-import org.jclouds.googlecomputeengine.domain.UrlMap.PathMatcher;
-import org.jclouds.googlecomputeengine.domain.UrlMap.UrlMapTest;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.json.SerializedNames;
-
-import com.google.auto.value.AutoValue;
-
-@AutoValue
-public abstract class UrlMapOptions {
-
- @Nullable public abstract String name();
- @Nullable public abstract String description();
- @Nullable public abstract List<HostRule> hostRules();
- @Nullable public abstract List<PathMatcher> pathMatchers();
- @Nullable public abstract List<UrlMapTest> tests();
- @Nullable public abstract URI defaultService();
- @Nullable public abstract String fingerprint();
-
- @SerializedNames({ "name", "description", "hostRules", "pathMatchers", "tests",
- "defaultService", "fingerprint"})
- static UrlMapOptions create(String name, String description, List<HostRule> hostRules,
- List<PathMatcher> pathMatchers, List<UrlMapTest> tests, URI defaultService, String fingerprint) {
- return new AutoValue_UrlMapOptions(name, description, hostRules,
- pathMatchers, tests, defaultService, fingerprint);
- }
-
- UrlMapOptions(){
- }
-
- public static class Builder {
-
- private String name;
- private String description;
- private List<HostRule> hostRules;
- private List<PathMatcher> pathMatchers;
- private List<UrlMapTest> tests;
- private URI defaultService;
- private String fingerprint;
-
- /**
- * Name of the UrlMap resource.
- */
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * An optional textual description of the UrlMap.
- */
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * Rules for matching and directing incoming hosts.
- */
- public Builder hostRules(List<HostRule> hostRules) {
- this.hostRules = hostRules;
- return this;
- }
-
- /**
- * The list of named PathMatchers to use against the URL.
- */
- public Builder pathMatchers(List<PathMatcher> pathMatchers) {
- this.pathMatchers = pathMatchers;
- return this;
- }
-
- /**
- * The list of expected URL mappings. Request to update this
- * UrlMap will succeed only all of the test cases pass.
- */
- public Builder tests(List<UrlMapTest> tests) {
- this.tests = tests;
- return this;
- }
-
- /**
- * The URL of the BackendService resource if none of the hostRules match.
- */
- public Builder defaultService(URI defaultService) {
- this.defaultService = defaultService;
- return this;
- }
-
- /**
- * Fingerprint of this resource. A hash of the contents stored in this object.
- * This field is used in optimistic locking. This field will be ignored when
- * inserting a UrlMap. An up-to-date fingerprint must be provided in order to
- * update the UrlMap.
- */
- public Builder fingerprint(String fingerprint) {
- this.fingerprint = fingerprint;
- return this;
- }
-
- /**
- * Builds the UrlMapOptions.
- * Note: This enforces that "name" and "defaultService" are not null as the GCE API expects.
- * If you are patching an existing UrlMap you may wish to use {@link #buildForPatch()} instead.
- */
- public UrlMapOptions build() {
- checkNotNull(name, "In UrlMapOptions: A UrlMap name cannot be null, if patching an existing UrlMap use buildForPatch() instead of build()");
- checkNotNull(defaultService, "In UrlMapOptions: A UrlMap defaultService cannot be null, if patching an existing UrlMap use buildForPatch() instead of build()");
- return create(name, description, hostRules, pathMatchers, tests,
- defaultService, fingerprint);
- }
-
- /**
- * This build option is specifically for when patching an existing UrlMap.
- * If not patching an existing urlMap it is recommended that you use {@link #build()}.
- */
- public UrlMapOptions buildForPatch() {
- return create(name, description, hostRules, pathMatchers, tests,
- defaultService, fingerprint);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadataTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadataTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadataTest.java
deleted file mode 100644
index 6204f64..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/GoogleComputeEngineProviderMetadataTest.java
+++ /dev/null
@@ -1,34 +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;
-
-import org.jclouds.providers.internal.BaseProviderMetadataTest;
-import org.testng.annotations.Test;
-
-/**
- * Tests that GoogleComputeProviderMetadata is properly registered in ServiceLoader
- * <p/>
- * <pre>
- * META-INF/services/org.jclouds.providers.ProviderMetadata
- * </pre>
- */
-@Test(groups = "unit", testName = "GoogleComputeEngineProviderMetadataTest")
-public class GoogleComputeEngineProviderMetadataTest extends BaseProviderMetadataTest {
- public GoogleComputeEngineProviderMetadataTest() {
- super(new GoogleComputeEngineProviderMetadata(), new GoogleComputeEngineApiMetadata());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinderTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinderTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinderTest.java
deleted file mode 100644
index a8b614e..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/DiskCreationBinderTest.java
+++ /dev/null
@@ -1,53 +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.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-import java.util.Map;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.DiskCreationOptions;
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-
-@Test(groups = "unit", testName = "DiskCreationBinderTest")
-public class DiskCreationBinderTest extends BaseGoogleComputeEngineExpectTest<Object>{
-
- private static final String FAKE_SOURCE_SNAPSHOT = "https://www.googleapis.com/compute/v1/projects/" +
- "debian-cloud/global/images/backports-debian-7-wheezy-v20141017";
-
- DiskCreationBinder binder = new DiskCreationBinder();
-
- @Test
- public void testMap() throws SecurityException, NoSuchMethodException {
- DiskCreationOptions diskCreationOptions = new DiskCreationOptions.Builder()
- .sourceSnapshot(URI.create(FAKE_SOURCE_SNAPSHOT)).sizeGb(15).description(null).build();
-
- HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://momma").build();
- Map<String, Object> postParams = ImmutableMap.of("name", "testName", "options", diskCreationOptions);
-
- request = binder.bindToRequest(request, postParams);
-
- assertEquals(request.getPayload().getRawContent(),
- "{\"name\":\"testName\",\"sizeGb\":15,\"sourceSnapshot\":\"" + FAKE_SOURCE_SNAPSHOT + "\"}");
- assertEquals(request.getPayload().getContentMetadata().getContentType(), "application/json");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java
deleted file mode 100644
index 5190129..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-import java.util.Map;
-
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.ForwardingRuleCreationOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.json.Json;
-import org.jclouds.json.internal.GsonWrapper;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.gson.Gson;
-
-@Test(groups = "unit", testName = "ForwardingRuleCreationBinderTest")
-public class ForwardingRuleCreationBinderTest extends BaseGoogleComputeEngineExpectTest<Object>{
-
- private static String DESCRIPTION = "This is a test!";
- private static String IP_ADDRESS = "1.2.1.1.1";
- private static String PORT_RANGE = "1.2.3.4.1";
- private static URI TARGET = URI.create(BASE_URL + "/party/regions/europe-west1/targetPools/test-target-pool");
-
- Json json = new GsonWrapper(new Gson());
-
- @Test
- public void testMap() throws SecurityException, NoSuchMethodException {
- ForwardingRuleCreationBinder binder = new ForwardingRuleCreationBinder(json);
- ForwardingRuleCreationOptions forwardingRuleCreationOptions = new ForwardingRuleCreationOptions.Builder()
- .description(DESCRIPTION)
- .ipAddress(IP_ADDRESS)
- .ipProtocol(ForwardingRule.IPProtocol.SCTP)
- .portRange(PORT_RANGE)
- .target(TARGET)
- .build();
-
- HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://momma").build();
- Map<String, Object> postParams = ImmutableMap.of("name", "testForwardingRuleName", "options", forwardingRuleCreationOptions);
-
- binder.bindToRequest(request, postParams);
-
- assertEquals(request.getPayload().getRawContent(),
- "{\""
- + "name\":\"testForwardingRuleName\","
- + "\"description\":\"" + DESCRIPTION + "\","
- + "\"IPAddress\":\"" + IP_ADDRESS + "\","
- + "\"IPProtocol\":\"SCTP\","
- + "\"portRange\":\"" + PORT_RANGE + "\","
- + "\"target\":\"" + TARGET + "\""
- + "}");
- assertEquals(request.getPayload().getContentMetadata().getContentType(), "application/json");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java
deleted file mode 100644
index fa4466f..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/HttpHealthCheckCreationBinderTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.Map;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.googlecomputeengine.options.HttpHealthCheckCreationOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.json.Json;
-import org.jclouds.json.internal.GsonWrapper;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.gson.Gson;
-
-@Test(groups = "unit", testName = "HttpHealthCheckCreationBinderTest")
-public class HttpHealthCheckCreationBinderTest extends BaseGoogleComputeEngineExpectTest<Object>{
-
- private String NAME = "testHttpHealthCheck";
- private Integer TIMEOUTSEC = 3;
- private Integer UNHEALTHYTHRESHOLD = 5;
- private Integer HEALTHYTHRESHOLD = 4;
- private static String DESCRIPTION = "This is a test!";
-
- Json json = new GsonWrapper(new Gson());
-
- @Test
- public void testMap() throws SecurityException, NoSuchMethodException {
- HttpHealthCheckCreationBinder binder = new HttpHealthCheckCreationBinder(json);
- HttpHealthCheckCreationOptions httpHealthCheckCreationOptions = new HttpHealthCheckCreationOptions.Builder()
- .timeoutSec(TIMEOUTSEC)
- .unhealthyThreshold(UNHEALTHYTHRESHOLD)
- .healthyThreshold(HEALTHYTHRESHOLD)
- .description(DESCRIPTION)
- .buildWithDefaults();
-
- HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://momma").build();
- Map<String, Object> postParams = ImmutableMap.of("name", NAME, "options", httpHealthCheckCreationOptions);
-
- binder.bindToRequest(request, postParams);
-
- assertEquals(request.getPayload().getRawContent(),
- "{"
- + "\"name\":\"" + NAME + "\","
- + "\"requestPath\":\"/\","
- + "\"port\":80,"
- + "\"checkIntervalSec\":5,"
- + "\"timeoutSec\":" + TIMEOUTSEC + ","
- + "\"unhealthyThreshold\":" + UNHEALTHYTHRESHOLD + ","
- + "\"healthyThreshold\":" + HEALTHYTHRESHOLD + ","
- + "\"description\":\"" + DESCRIPTION + "\""
- + "}");
- assertEquals(request.getPayload().getContentMetadata().getContentType(), "application/json");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/TargetPoolAddInstanceBinderTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/TargetPoolAddInstanceBinderTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/TargetPoolAddInstanceBinderTest.java
deleted file mode 100644
index d20fb22..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/TargetPoolAddInstanceBinderTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineExpectTest;
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-@Test(groups = "unit", testName = "TargetPoolAddInstanceBinderTest")
-public class TargetPoolAddInstanceBinderTest extends BaseGoogleComputeEngineExpectTest<Object>{
-
- private static final List<URI> FAKE_INSTANCES = ImmutableList.of(
- URI.create("https://www.googleapis.com/compute/v1/" +
- "projects/project/zones/us-central1-a/instances/instance-1"),
- URI.create("https://www.googleapis.com/compute/v1/" +
- "projects/project/zones/us-central1-a/instances/instance-2"));
-
- TargetPoolChangeInstancesBinder binder = new TargetPoolChangeInstancesBinder();
-
- @Test
- public void testMap() throws SecurityException, NoSuchMethodException {
- HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://momma").build();
- Map<String, Object> postParams = ImmutableMap.of("instances", (Object) FAKE_INSTANCES);
-
- binder.bindToRequest(request, postParams);
-
- assertEquals(request.getPayload().getRawContent(),
- "{"
- + "\"instances\":["
- + "{\"instance\":\"https://www.googleapis.com/compute/v1/projects/project/zones/us-central1-a/instances/instance-1\"},"
- + "{\"instance\":\"https://www.googleapis.com/compute/v1/projects/project/zones/us-central1-a/instances/instance-2\"}"
- + "]"
- + "}");
- assertEquals(request.getPayload().getContentMetadata().getContentType(), "application/json");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java
deleted file mode 100644
index afaa5bb..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceLiveTest.java
+++ /dev/null
@@ -1,149 +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.compute;
-
-import static com.google.common.collect.Iterables.contains;
-import static org.jclouds.util.Strings2.toStringAndClose;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-import java.util.Properties;
-import java.util.Set;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.inject.Module;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.internal.BaseComputeServiceLiveTest;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.predicates.NodePredicates;
-import org.jclouds.googlecloud.internal.TestProperties;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.sshj.config.SshjSshClientModule;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", singleThreaded = true)
-public class GoogleComputeEngineServiceLiveTest extends BaseComputeServiceLiveTest {
-
- protected static final String DEFAULT_ZONE_NAME = "us-central1-a";
-
- public GoogleComputeEngineServiceLiveTest() {
- provider = "google-compute-engine";
- }
-
- @Override protected Properties setupProperties() {
- TestProperties.setGoogleCredentialsFromJson(provider);
- return TestProperties.apply(provider, super.setupProperties());
- }
-
- public void testListHardwareProfiles() throws Exception {
- GoogleComputeEngineApi api = client.getContext().unwrapApi(GoogleComputeEngineApi.class);
- ImmutableSet.Builder<String> deprecatedMachineTypes = ImmutableSet.builder();
- for (MachineType machine : api.machineTypesInZone(DEFAULT_ZONE_NAME).list().next()) {
- if (machine.deprecated() != null) {
- deprecatedMachineTypes.add(machine.id());
- }
- }
- ImmutableSet<String> deprecatedMachineTypeIds = deprecatedMachineTypes.build();
- for (Hardware hardwareProfile : client.listHardwareProfiles()) {
- assertFalse(contains(deprecatedMachineTypeIds, hardwareProfile.getId()));
- }
- }
-
- public void testCreateNodeWithSsd() throws Exception {
- String group = this.group + "ssd";
- try {
- TemplateOptions options = client.templateOptions();
-
- options.as(GoogleComputeEngineTemplateOptions.class).bootDiskType("pd-ssd");
-
- // create a node
- Set<? extends NodeMetadata> nodes =
- client.createNodesInGroup(group, 1, options);
- assertEquals(nodes.size(), 1, "One node should have been created");
-
- // Verify the disk on the instance is an ssd.
- NodeMetadata node = Iterables.get(nodes, 0);
- GoogleComputeEngineApi api = client.getContext().unwrapApi(GoogleComputeEngineApi.class);
- Instance instance = api.instancesInZone(node.getLocation().getId()).get(node.getName());
- Disk disk = api.disksInZone(node.getLocation().getId()).get(toName(instance.disks().get(0).source()));
- assertTrue(disk.type().toString().endsWith("pd-ssd"));
-
- } finally {
- client.destroyNodesMatching(NodePredicates.inGroup(group));
- }
- }
- /**
- * Nodes may have additional metadata entries (particularly they may have an "sshKeys" entry)
- */
- protected void checkUserMetadataInNodeEquals(NodeMetadata node, ImmutableMap<String, String> userMetadata) {
- assertTrue(node.getUserMetadata().keySet().containsAll(userMetadata.keySet()));
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- @Override
- public void testCorrectAuthException() throws Exception {
- ComputeServiceContext context = null;
- try {
- String credential = toStringAndClose(getClass().getResourceAsStream("/test"));
- Properties overrides = setupProperties();
- overrides.setProperty(provider + ".identity", "000000000000@developer.gserviceaccount.com");
- overrides.setProperty(provider + ".credential", credential);
- context = newBuilder()
- .modules(ImmutableSet.of(getLoggingModule(), credentialStoreModule))
- .overrides(overrides).build(ComputeServiceContext.class);
- context.getComputeService().listNodes();
- } catch (AuthorizationException e) {
- throw e;
- } catch (RuntimeException e) {
- e.printStackTrace();
- throw e;
- } finally {
- if (context != null)
- context.close();
- }
- }
-
- @Override
- protected Module getSshModule() {
- return new SshjSshClientModule();
- }
-
- @Override
- protected void checkTagsInNodeEquals(NodeMetadata node, ImmutableSet<String> tags) {
- Set<String> nodeTags = node.getTags();
- for (String tag : tags){
- assert nodeTags.contains(tag) : String.format("node tags did not match %s %s node:", tags, nodeTags, node);
- }
- }
-
- private static String toName(URI link) {
- String path = link.getPath();
- return path.substring(path.lastIndexOf('/') + 1);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceMockTest.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceMockTest.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceMockTest.java
deleted file mode 100644
index 4eb7aef..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceMockTest.java
+++ /dev/null
@@ -1,270 +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.compute;
-
-import static com.google.common.collect.Iterables.getOnlyElement;
-import static org.jclouds.googlecomputeengine.domain.Instance.Status.RUNNING;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Set;
-
-import com.google.common.collect.ImmutableSet;
-import com.squareup.okhttp.mockwebserver.MockResponse;
-import org.jclouds.compute.ComputeService;
-import org.jclouds.compute.domain.ComputeMetadata;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationScope;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiMockTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "GoogleComputeEngineServiceMockTest", singleThreaded = true)
-public class GoogleComputeEngineServiceMockTest extends BaseGoogleComputeEngineApiMockTest {
-
- public void templateMatch() throws Exception {
- server.enqueue(singleRegionSingleZoneResponse());
- server.enqueue(jsonResponse("/image_list.json"));
- server.enqueue(jsonResponse("/image_list_debian.json")); // per IMAGE_PROJECTS = "debian-cloud"
- server.enqueue(jsonResponse("/aggregated_machinetype_list.json"));
-
- ComputeService computeService = computeService();
-
- Template template = computeService.templateBuilder().build();
- Hardware defaultSize = computeService.templateBuilder().build().getHardware();
-
- Hardware smallest = computeService.templateBuilder().smallest().build().getHardware();
- assertEquals(defaultSize, smallest);
-
- Hardware fastest = computeService.templateBuilder().fastest().build().getHardware();
- assertNotNull(fastest);
-
- assertEquals(computeService.listHardwareProfiles().size(), 3);
-
- Template toMatch = computeService.templateBuilder().imageId(template.getImage().getId()).build();
- assertEquals(toMatch.getImage(), template.getImage());
-
- assertSent(server, "GET", "/projects/party/regions");
- assertSent(server, "GET", "/projects/party/global/images");
- assertSent(server, "GET", "/projects/debian-cloud/global/images");
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes");
- }
-
- public void firewallDeletedWhenAllGroupNodesAreTerminated() throws IOException, InterruptedException {
- server.enqueue(instanceWithNetworkAndStatus("test-delete-1", "default", RUNNING));
- server.enqueue(singleRegionSingleZoneResponse());
- server.enqueue(jsonResponse("/disk_get_with_source_image.json"));
- server.enqueue(jsonResponse("/image_get_for_source_image.json"));
- server.enqueue(jsonResponse("/aggregated_machinetype_list.json")); // Why are we getting machineTypes to delete an instance?
- server.enqueue(instanceWithNetworkAndStatus("test-delete-1", "default", RUNNING));
- server.enqueue(jsonResponse("/operation.json")); // instance delete
- server.enqueue(jsonResponse("/zone_operation.json"));
- server.enqueue(response404()); // deleted instance no longer exists
- server.enqueue(aggregatedListInstanceEmpty());
- server.enqueue(jsonResponse("/firewall_list_compute.json"));
- server.enqueue(jsonResponse("/operation.json"));
- server.enqueue(jsonResponse("/zone_operation.json"));
-
- ComputeService computeService = computeService();
- computeService.destroyNode(url("/jclouds/zones/us-central1-a/instances/test-delete-1"));
-
- assertSent(server, "GET", "/jclouds/zones/us-central1-a/instances/test-delete-1");
- assertSent(server, "GET", "/projects/party/regions");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks/test");
- assertSent(server, "GET", "/projects/debian-cloud/global/images/debian-7-wheezy-v20140718");
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes"); // Why are we getting machineTypes to delete an instance?
- assertSent(server, "GET", "/jclouds/zones/us-central1-a/instances/test-delete-1");
- assertSent(server, "DELETE", "/jclouds/zones/us-central1-a/instances/test-delete-1"); // instance delete
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations/operation-1354084865060");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances/test-delete-1"); // get instance
- assertSent(server, "GET", "/projects/party/aggregated/instances");
- assertSent(server, "GET", "/projects/party/global/firewalls");
- assertSent(server, "DELETE", "/projects/party/global/firewalls/jclouds-test-delete-34sf");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations/operation-1354084865060");
- }
-
-
- public void listAssignableLocations() throws Exception {
- server.enqueue(singleRegionSingleZoneResponse());
-
- ComputeService computeService = computeService();
-
- Set<? extends Location> locations = computeService.listAssignableLocations();
-
- assertNotNull(locations);
- assertEquals(locations.size(), 1);
- Location firstZone = locations.iterator().next();
- assertEquals(firstZone.getId(), "us-central1-a");
- assertEquals(firstZone.getDescription(), url("/projects/party/zones/us-central1-a"));
- assertEquals(firstZone.getScope(), LocationScope.ZONE);
-
- assertEquals(firstZone.getParent().getId(), "us-central1");
- assertEquals(firstZone.getParent().getDescription(), url("/projects/party/regions/us-central1"));
- assertEquals(firstZone.getParent().getScope(), LocationScope.REGION);
-
- // Google intentionally does not document locations!
- assertTrue(firstZone.getIso3166Codes().isEmpty());
- assertTrue(firstZone.getParent().getIso3166Codes().isEmpty());
-
- assertSent(server, "GET", "/projects/party/regions");
- }
-
- public void listNodes() throws Exception {
- server.enqueue(aggregatedListWithInstanceNetworkAndStatus("test-0", "test-network", RUNNING));
- server.enqueue(singleRegionSingleZoneResponse());
- server.enqueue(jsonResponse("/disk_get_with_source_image.json"));
- server.enqueue(jsonResponse("/image_get_for_source_image.json"));
- server.enqueue(jsonResponse("/aggregated_machinetype_list.json"));
-
- Set<? extends ComputeMetadata> nodes = computeService().listNodes();
- assertEquals(nodes.size(), 1);
- NodeMetadata node = (NodeMetadata) nodes.iterator().next();
- assertNotNull(node.getImageId());
-
- assertSent(server, "GET", "/projects/party/aggregated/instances");
- assertSent(server, "GET", "/projects/party/regions");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks/test");
- assertSent(server, "GET", "/projects/debian-cloud/global/images/debian-7-wheezy-v20140718");
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes");
- }
-
- public void createNodeWhenFirewallDoesNotExist() throws Exception {
- server.enqueue(singleRegionSingleZoneResponse());
- server.enqueue(jsonResponse("/image_list.json"));
- server.enqueue(jsonResponse("/image_list_debian.json")); // per IMAGE_PROJECTS = "debian-cloud"
- server.enqueue(jsonResponse("/aggregated_machinetype_list.json"));
- server.enqueue(jsonResponse("/network_get_default.json"));
- server.enqueue(new MockResponse().setResponseCode(404)); // Get Firewall
- server.enqueue(jsonResponse("/operation.json")); // Create Firewall
- server.enqueue(jsonResponse("/zone_operation.json"));
- server.enqueue(aggregatedListWithInstanceNetworkAndStatus("test-0", "test-network", RUNNING));
- server.enqueue(jsonResponse("/disk_get_with_source_image.json"));
- server.enqueue(jsonResponse("/image_get_for_source_image.json"));
- server.enqueue(jsonResponse("/operation.json")); // Create Instance
- server.enqueue(instanceWithNetworkAndStatus("test-1", "test-network", RUNNING));
-
- ComputeService computeService = computeService();
-
- GoogleComputeEngineTemplateOptions options = computeService.templateOptions()
- .as(GoogleComputeEngineTemplateOptions.class).autoCreateKeyPair(false)
- .tags(ImmutableSet.of("aTag")).blockUntilRunning(false);
-
- Template template = computeService.templateBuilder().options(options).build();
- NodeMetadata node = getOnlyElement(computeService.createNodesInGroup("test", 1, template));
-
- // prove our caching works.
- assertEquals(node.getImageId(), template.getImage().getId());
-
- assertSent(server, "GET", "/projects/party/regions");
- assertSent(server, "GET", "/projects/party/global/images");
- assertSent(server, "GET", "/projects/debian-cloud/global/images");
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes");
- assertSent(server, "GET", "/projects/party/global/networks/default");
- assertSent(server, "GET", "/projects/party/global/firewalls/jclouds-test-65f"); // Get Firewall
- assertSent(server, "POST", "/projects/party/global/firewalls", // Create Firewall
- stringFromResource("/firewall_insert_2.json"));
-
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations/operation-1354084865060");
- assertSent(server, "GET", "/projects/party/aggregated/instances");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks/test");
- assertSent(server, "GET", "/projects/debian-cloud/global/images/debian-7-wheezy-v20140718");
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances",
- String.format(stringFromResource("/instance_insert_2.json"), template.getHardware().getId(), template.getImage().getId()));
-
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances/test-1");
- }
-
- public void createNodeWithSpecificDiskType() throws Exception {
- server.enqueue(singleRegionSingleZoneResponse());
- server.enqueue(jsonResponse("/image_list.json"));
- server.enqueue(jsonResponse("/image_list_debian.json")); // per IMAGE_PROJECTS = "debian-cloud"
- server.enqueue(jsonResponse("/aggregated_machinetype_list.json"));
- server.enqueue(jsonResponse("/network_get_default.json"));
- server.enqueue(new MockResponse().setResponseCode(404)); // Get Firewall
- server.enqueue(jsonResponse("/operation.json")); // Create Firewall
- server.enqueue(jsonResponse("/zone_operation.json"));
- server.enqueue(aggregatedListWithInstanceNetworkAndStatus("test-0", "test-network", RUNNING));
- server.enqueue(jsonResponse("/disk_get_with_source_image.json"));
- server.enqueue(jsonResponse("/image_get_for_source_image.json"));
- server.enqueue(jsonResponse("/disktype_ssd.json"));
- server.enqueue(jsonResponse("/operation.json")); // Create Instance
- server.enqueue(instanceWithNetworkAndStatusAndSsd("test-1", "test-network", RUNNING));
-
- ComputeService computeService = computeService();
-
- GoogleComputeEngineTemplateOptions options = computeService.templateOptions()
- .as(GoogleComputeEngineTemplateOptions.class).autoCreateKeyPair(false)
- .tags(ImmutableSet.of("aTag")).blockUntilRunning(false)
- .bootDiskType("pd-ssd");
-
- Template template = computeService.templateBuilder().options(options).build();
- NodeMetadata node = getOnlyElement(computeService.createNodesInGroup("test", 1, template));
-
- // prove our caching works.
- assertEquals(node.getImageId(), template.getImage().getId());
- assertEquals(node.getLocation().getId(), template.getLocation().getId());
-
- assertSent(server, "GET", "/projects/party/regions");
- assertSent(server, "GET", "/projects/party/global/images");
- assertSent(server, "GET", "/projects/debian-cloud/global/images");
- assertSent(server, "GET", "/projects/party/aggregated/machineTypes");
- assertSent(server, "GET", "/projects/party/global/networks/default");
- assertSent(server, "GET", "/projects/party/global/firewalls/jclouds-test-65f"); // Get Firewall
- assertSent(server, "POST", "/projects/party/global/firewalls", // Create Firewall
- stringFromResource("/firewall_insert_2.json"));
-
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/operations/operation-1354084865060");
- assertSent(server, "GET", "/projects/party/aggregated/instances");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/disks/test");
- assertSent(server, "GET", "/projects/debian-cloud/global/images/debian-7-wheezy-v20140718");
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/diskTypes/pd-ssd");
- assertSent(server, "POST", "/projects/party/zones/us-central1-a/instances",
- String.format(stringFromResource("/instance_insert_ssd.json"), template.getHardware().getId(), template.getImage().getId()));
-
- assertSent(server, "GET", "/projects/party/zones/us-central1-a/instances/test-1");
- }
-
- private MockResponse instanceWithNetworkAndStatus(String instanceName, String networkName, Instance.Status status) {
- return new MockResponse().setBody(
- stringFromResource("/instance_get.json").replace("test-0", instanceName).replace("default", networkName)
- .replace("RUNNING", status.toString()));
- }
-
- private MockResponse instanceWithNetworkAndStatusAndSsd(String instanceName, String networkName, Instance.Status status) {
- return new MockResponse().setBody(
- stringFromResource("/instance_get.json").replace("test-0", instanceName).replace("default", networkName)
- .replace("RUNNING", status.toString()).replace("pd-standard", "pd-ssd"));
- }
-
- private MockResponse aggregatedListWithInstanceNetworkAndStatus(String instanceName, String networkName,
- Instance.Status status) {
- return new MockResponse().setBody(
- stringFromResource("/aggregated_instance_list.json").replace("test-0", instanceName)
- .replace("default", networkName).replace("RUNNING", status.toString()));
- }
-
- private MockResponse aggregatedListInstanceEmpty() {
- return new MockResponse().setBody(stringFromResource("/aggregated_instance_list_empty.json"));
- }
-}
-
[03/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/global_operation.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/global_operation.json b/google-compute-engine/src/test/resources/global_operation.json
deleted file mode 100644
index fc1086d..0000000
--- a/google-compute-engine/src/test/resources/global_operation.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/global/firewalls/jclouds-test-delete",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/global_operation_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/global_operation_list.json b/google-compute-engine/src/test/resources/global_operation_list.json
deleted file mode 100644
index 4be4783..0000000
--- a/google-compute-engine/src/test/resources/global_operation_list.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "kind": "compute#operationList",
- "id": "projects/party/global/operations",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/operations",
- "items": [
- {
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/global/firewalls/jclouds-test-delete",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/health_status_get_health.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/health_status_get_health.json b/google-compute-engine/src/test/resources/health_status_get_health.json
deleted file mode 100644
index 62dcc0d..0000000
--- a/google-compute-engine/src/test/resources/health_status_get_health.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "kind": "compute#backendServiceGroupHealth",
- "healthStatus": [
- {
- "port": 80,
- "instance": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/jclouds-test",
- "healthState": "HEALTHY"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/httphealthcheck_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/httphealthcheck_get.json b/google-compute-engine/src/test/resources/httphealthcheck_get.json
deleted file mode 100644
index fc3007d..0000000
--- a/google-compute-engine/src/test/resources/httphealthcheck_get.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "kind": "compute#httpHealthCheck",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party-gce/global/httpHealthChecks/http-health-check-api-live-test",
- "id": "2761502483700014319",
- "creationTimestamp": "2014-01-14T05:55:54.910-08:00",
- "name": "http-health-check-api-live-test",
- "description": "Test Health Check",
- "requestPath": "/",
- "port": 80,
- "checkIntervalSec": 5,
- "timeoutSec": 5,
- "unhealthyThreshold": 2,
- "healthyThreshold": 2
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/httphealthcheck_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/httphealthcheck_insert.json b/google-compute-engine/src/test/resources/httphealthcheck_insert.json
deleted file mode 100644
index 6ad0077..0000000
--- a/google-compute-engine/src/test/resources/httphealthcheck_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"http-health-check","requestPath":"/","port":80,"checkIntervalSec":5,"timeoutSec":0,"unhealthyThreshold":0,"healthyThreshold":2}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/httphealthcheck_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/httphealthcheck_list.json b/google-compute-engine/src/test/resources/httphealthcheck_list.json
deleted file mode 100644
index 45aaeb1..0000000
--- a/google-compute-engine/src/test/resources/httphealthcheck_list.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "kind": "compute#httpHealthCheckList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party-gce/global/httpHealthChecks",
- "id": "projects/party-gce/global/httpHealthChecks",
- "items": [
- {
- "kind": "compute#httpHealthCheck",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party-gce/global/httpHealthChecks/http-health-check-api-live-test",
- "id": "2761502483700014319",
- "creationTimestamp": "2014-01-14T05:55:54.910-08:00",
- "name": "http-health-check-api-live-test",
- "description": "Test Health Check",
- "requestPath": "/",
- "port": 80,
- "checkIntervalSec": 5,
- "timeoutSec": 5,
- "unhealthyThreshold": 2,
- "healthyThreshold": 2
- },
- {
- "kind": "compute#httpHealthCheck",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party-gce/global/httpHealthChecks/myname-andrea-kmzmi1bh-http-health-check",
- "id": "1035854271083519643",
- "creationTimestamp": "2014-01-08T14:38:29.363-08:00",
- "name": "myname-andrea-kmzmi1bh-http-health-check",
- "timeoutSec": 5,
- "unhealthyThreshold": 2
- },
- {
- "kind": "compute#httpHealthCheck",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party-gce/global/httpHealthChecks/myname-andrea-zk7gadwq-http-health-check",
- "id": "7006563292274658743",
- "creationTimestamp": "2014-01-08T14:48:03.276-08:00",
- "name": "myname-andrea-zk7gadwq-http-health-check",
- "timeoutSec": 5,
- "unhealthyThreshold": 2
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/httphealthcheck_patch.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/httphealthcheck_patch.json b/google-compute-engine/src/test/resources/httphealthcheck_patch.json
deleted file mode 100644
index 65c089b..0000000
--- a/google-compute-engine/src/test/resources/httphealthcheck_patch.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"http-health-check","timeoutSec":0,"unhealthyThreshold":0}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_deprecate.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_deprecate.json b/google-compute-engine/src/test/resources/image_deprecate.json
deleted file mode 100644
index c40cc03..0000000
--- a/google-compute-engine/src/test/resources/image_deprecate.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326test",
- "deprecated": "2014-07-16T22:16:13.468Z",
- "obsolete": "2014-10-16T22:16:13.468Z",
- "deleted": "2015-01-16T22:16:13.468Z"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_get.json b/google-compute-engine/src/test/resources/image_get.json
deleted file mode 100644
index 3a0b0b1..0000000
--- a/google-compute-engine/src/test/resources/image_get.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "kind": "compute#image",
- "id": "12941197498378735318",
- "creationTimestamp": "2012-07-16T22:16:13.468",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326",
- "name": "centos-6-2-v20120326",
- "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000",
- "sourceType": "RAW",
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20130104"
- },
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "status": "READY",
- "archiveSizeBytes": "881210631",
- "diskSizeGb": "8",
- "sourceDisk": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disk/disk",
- "sourceDiskId": "9598530021316715047",
- "licenses": [
- "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12"
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_get_for_source_image.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_get_for_source_image.json b/google-compute-engine/src/test/resources/image_get_for_source_image.json
deleted file mode 100644
index acf311e..0000000
--- a/google-compute-engine/src/test/resources/image_get_for_source_image.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "kind": "compute#image",
- "id": "12941197498378735318",
- "creationTimestamp": "2012-07-16T22:16:13.468",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718",
- "name": "debian-7-wheezy-v20140718",
- "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000",
- "sourceType": "RAW",
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/party/global/images/centos-6-v20130104"
- },
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "status": "READY",
- "archiveSizeBytes": "881210631",
- "diskSizeGb": "8",
- "sourceDisk": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disk/disk",
- "sourceDiskId": "9598530021316715047",
- "licenses": [
- "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12"
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_insert.json b/google-compute-engine/src/test/resources/image_insert.json
deleted file mode 100644
index fd030a7..0000000
--- a/google-compute-engine/src/test/resources/image_insert.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{"sourceType": "RAW", "rawDisk": {
- "source": "https://storage.googleapis.com/mybuket/myimage.image.tar.gz",
- "containerType": "TAR"
-}, "kind": "compute#image", "name": "myimage"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_insert_from_pd.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_insert_from_pd.json b/google-compute-engine/src/test/resources/image_insert_from_pd.json
deleted file mode 100644
index 6f72d62..0000000
--- a/google-compute-engine/src/test/resources/image_insert_from_pd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"my-image","sourceDisk":"https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/mydisk"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list.json b/google-compute-engine/src/test/resources/image_list.json
deleted file mode 100644
index 0fc7194..0000000
--- a/google-compute-engine/src/test/resources/image_list.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "kind": "compute#imageList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images",
- "id": "projects/centos-cloud/global/images",
- "items": [
- {
- "kind": "compute#image",
- "id": "12941197498378735318",
- "creationTimestamp": "2012-07-16T22:16:13.468",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326",
- "name": "centos-6-2-v20120326",
- "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000",
- "sourceType": "RAW",
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20130104"
- },
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "status": "READY",
- "archiveSizeBytes": "881210631",
- "diskSizeGb": "8",
- "sourceDisk": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disk/disk",
- "sourceDiskId": "9598530021316715047",
- "licenses": [
- "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12"
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list_centos.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list_centos.json b/google-compute-engine/src/test/resources/image_list_centos.json
deleted file mode 100644
index 55e1b21..0000000
--- a/google-compute-engine/src/test/resources/image_list_centos.json
+++ /dev/null
@@ -1,183 +0,0 @@
-{
- "kind": "compute#imageList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images",
- "id": "projects/centos-cloud/global/images",
- "items": [
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20131120",
- "id": "11748647391859510935",
- "creationTimestamp": "2013-11-25T15:13:50.611-08:00",
- "name": "centos-6-v20131120",
- "description": "SCSI-enabled CentOS 6 built on 2013-11-20",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140318"
- },
- "status": "READY",
- "archiveSizeBytes": "269993565",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140318",
- "id": "11743140967858608122",
- "creationTimestamp": "2014-03-19T15:01:13.388-07:00",
- "name": "centos-6-v20140318",
- "description": "CentOS 6.5 x86_64 built on 2014-03-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140408"
- },
- "status": "READY",
- "archiveSizeBytes": "341230444",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140408",
- "id": "18033188469723077298",
- "creationTimestamp": "2014-04-09T10:31:57.518-07:00",
- "name": "centos-6-v20140408",
- "description": "CentOS 6.5 x86_64 built on 2014-04-08",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140415"
- },
- "status": "READY",
- "archiveSizeBytes": "342252847",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140415",
- "id": "10463166969914166288",
- "creationTimestamp": "2014-04-22T12:05:16.927-07:00",
- "name": "centos-6-v20140415",
- "description": "CentOS 6.5 x86_64 built on 2014-04-15",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140522"
- },
- "status": "READY",
- "archiveSizeBytes": "1026663807",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140522",
- "id": "14390164727436022001",
- "creationTimestamp": "2014-06-03T10:21:42.109-07:00",
- "name": "centos-6-v20140522",
- "description": "CentOS 6.5 x86_64 built on 2014-05-22",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140606"
- },
- "status": "READY",
- "archiveSizeBytes": "1028292810",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140605",
- "id": "16310166269920012092",
- "creationTimestamp": "2014-06-05T11:04:45.767-07:00",
- "name": "centos-6-v20140605",
- "description": "CentOS 6.5 x86_64 built on 2014-06-05",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140606"
- },
- "status": "READY",
- "archiveSizeBytes": "1028745777",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140606",
- "id": "6290630306542078308",
- "creationTimestamp": "2014-06-06T13:16:42.265-07:00",
- "name": "centos-6-v20140606",
- "description": "CentOS 6.5 x86_64 built on 2014-06-06",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140619"
- },
- "status": "READY",
- "archiveSizeBytes": "1028757792",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140619",
- "id": "3614861379648377676",
- "creationTimestamp": "2014-06-24T13:28:11.552-07:00",
- "name": "centos-6-v20140619",
- "description": "CentOS 6.5 x86_64 built on 2014-06-19",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140718"
- },
- "status": "READY",
- "archiveSizeBytes": "1029860991",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140718",
- "id": "16259951858818091437",
- "creationTimestamp": "2014-07-24T09:02:18.298-07:00",
- "name": "centos-6-v20140718",
- "description": "CentOS 6.5 x86_64 built on 2014-07-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "status": "READY",
- "archiveSizeBytes": "1031630715",
- "diskSizeGb": "10"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list_debian.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list_debian.json b/google-compute-engine/src/test/resources/image_list_debian.json
deleted file mode 100644
index c2614c9..0000000
--- a/google-compute-engine/src/test/resources/image_list_debian.json
+++ /dev/null
@@ -1,400 +0,0 @@
-{
- "kind": "compute#imageList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images",
- "id": "projects/debian-cloud/global/images",
- "items": [
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20131127",
- "id": "12371298324486102144",
- "creationTimestamp": "2013-12-02T17:49:01.206-08:00",
- "name": "backports-debian-7-wheezy-v20131127",
- "description": "Debian GNU/Linux 7.2 (wheezy) with backports kernel built on 2013-11-27",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140318"
- },
- "status": "READY",
- "archiveSizeBytes": "365056004",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140318",
- "id": "4359542978415320596",
- "creationTimestamp": "2014-03-19T14:59:48.212-07:00",
- "name": "backports-debian-7-wheezy-v20140318",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 with backports kernel built on 2014-03-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140331"
- },
- "status": "READY",
- "archiveSizeBytes": "363791902",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140331",
- "id": "15835408046770346721",
- "creationTimestamp": "2014-04-02T13:22:10.344-07:00",
- "name": "backports-debian-7-wheezy-v20140331",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 with backports kernel and SSH packages built on 2014-03-31",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140408"
- },
- "status": "READY",
- "archiveSizeBytes": "442398181",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140408",
- "id": "11347897274148340677",
- "creationTimestamp": "2014-04-09T10:34:36.072-07:00",
- "name": "backports-debian-7-wheezy-v20140408",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 with backports kernel and SSH packages built on 2014-04-08",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140415"
- },
- "status": "READY",
- "archiveSizeBytes": "460293681",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140415",
- "id": "1961353585117201359",
- "creationTimestamp": "2014-04-22T12:05:21.799-07:00",
- "name": "backports-debian-7-wheezy-v20140415",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 with backports kernel and SSH packages built on 2014-04-15",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140522"
- },
- "status": "READY",
- "archiveSizeBytes": "1305361944",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140522",
- "id": "9086860851120583043",
- "creationTimestamp": "2014-06-03T10:22:40.439-07:00",
- "name": "backports-debian-7-wheezy-v20140522",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 with backports kernel and SSH packages built on 2014-05-22",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140606"
- },
- "status": "READY",
- "archiveSizeBytes": "1291544127",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140605",
- "id": "3162880700849242534",
- "creationTimestamp": "2014-06-05T11:15:06.942-07:00",
- "name": "backports-debian-7-wheezy-v20140605",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 with backports kernel and SSH packages built on 2014-06-05",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140606"
- },
- "status": "READY",
- "archiveSizeBytes": "1342678611",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140606",
- "id": "10385475893990329896",
- "creationTimestamp": "2014-06-06T13:16:42.088-07:00",
- "name": "backports-debian-7-wheezy-v20140606",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 with backports kernel and SSH packages built on 2014-06-06",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140619"
- },
- "status": "READY",
- "archiveSizeBytes": "1356729999",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140619",
- "id": "15689321734978914353",
- "creationTimestamp": "2014-06-24T13:29:10.490-07:00",
- "name": "backports-debian-7-wheezy-v20140619",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 with backports kernel and SSH packages built on 2014-06-19",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140718"
- },
- "status": "READY",
- "archiveSizeBytes": "1281043596",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-v20140718",
- "id": "12577251946941921963",
- "creationTimestamp": "2014-07-24T09:10:05.365-07:00",
- "name": "backports-debian-7-wheezy-v20140718",
- "description": "Debian GNU/Linux 7.6 (wheezy) amd64 with backports kernel and SSH packages built on 2014-07-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "status": "READY",
- "archiveSizeBytes": "1335987075",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131014",
- "id": "2768298251193329825",
- "creationTimestamp": "2013-10-28T13:52:08.233-07:00",
- "name": "debian-7-wheezy-v20131014",
- "description": "Debian GNU/Linux 7.2 (wheezy) built on 2013-10-14",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
- "deprecated": "2013-12-02T12:00:00Z"
- },
- "status": "READY",
- "archiveSizeBytes": "405683884",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
- "id": "17312518942796567788",
- "creationTimestamp": "2013-11-25T15:17:00.436-08:00",
- "name": "debian-7-wheezy-v20131120",
- "description": "Debian GNU/Linux 7.2 (wheezy) built on 2013-11-20",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140318"
- },
- "status": "READY",
- "archiveSizeBytes": "341857472",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140318",
- "id": "17164003659829548087",
- "creationTimestamp": "2014-03-19T15:00:34.317-07:00",
- "name": "debian-7-wheezy-v20140318",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 built on 2014-03-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140408"
- },
- "status": "READY",
- "archiveSizeBytes": "357365652",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140408",
- "id": "5009074516965108296",
- "creationTimestamp": "2014-04-09T10:32:46.862-07:00",
- "name": "debian-7-wheezy-v20140408",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 built on 2014-04-08",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140415"
- },
- "status": "READY",
- "archiveSizeBytes": "387525228",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140415",
- "id": "17362901286054305778",
- "creationTimestamp": "2014-04-22T12:05:19.303-07:00",
- "name": "debian-7-wheezy-v20140415",
- "description": "Debian GNU/Linux 7.4 (wheezy) amd64 built on 2014-04-15",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140522"
- },
- "status": "READY",
- "archiveSizeBytes": "1151530332",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140522",
- "id": "5741466168076626639",
- "creationTimestamp": "2014-06-03T10:22:05.775-07:00",
- "name": "debian-7-wheezy-v20140522",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 built on 2014-05-22",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140606"
- },
- "status": "READY",
- "archiveSizeBytes": "1129290498",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140605",
- "id": "15036511115619902874",
- "creationTimestamp": "2014-06-05T11:10:23.037-07:00",
- "name": "debian-7-wheezy-v20140605",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 built on 2014-06-05",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140606"
- },
- "status": "READY",
- "archiveSizeBytes": "1064425338",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140606",
- "id": "16280724435269635469",
- "creationTimestamp": "2014-06-06T13:16:42.897-07:00",
- "name": "debian-7-wheezy-v20140606",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 built on 2014-06-06",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140619"
- },
- "status": "READY",
- "archiveSizeBytes": "1108438332",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140619",
- "id": "15990799122418306096",
- "creationTimestamp": "2014-06-24T13:28:42.697-07:00",
- "name": "debian-7-wheezy-v20140619",
- "description": "Debian GNU/Linux 7.5 (wheezy) amd64 built on 2014-06-19",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718"
- },
- "status": "READY",
- "archiveSizeBytes": "1158839577",
- "diskSizeGb": "10"
- },
- {
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718",
- "id": "11535450626613878896",
- "creationTimestamp": "2014-07-24T09:06:16.694-07:00",
- "name": "debian-7-wheezy-v20140718",
- "description": "Debian GNU/Linux 7.6 (wheezy) amd64 built on 2014-07-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "status": "READY",
- "archiveSizeBytes": "1195066695",
- "diskSizeGb": "10"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list_empty.json b/google-compute-engine/src/test/resources/image_list_empty.json
deleted file mode 100644
index f082e08..0000000
--- a/google-compute-engine/src/test/resources/image_list_empty.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "kind": "compute#imageList",
- "id": "projects/debian-cloud/global/images",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images",
- "items": [ ]
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list_multiple_page_1.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list_multiple_page_1.json b/google-compute-engine/src/test/resources/image_list_multiple_page_1.json
deleted file mode 100644
index 3ffcfd5..0000000
--- a/google-compute-engine/src/test/resources/image_list_multiple_page_1.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "kind": "compute#imageList",
- "id": "projects/centos-cloud/global/images",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images",
- "nextPageToken": "CgVJTUFHRRIbZ29vZ2xlLmNlbnRvcy02LTItdjIwMTIwNjIx",
- "items": [
- {
- "kind": "compute#image",
- "id": "12941197498378735318",
- "creationTimestamp": "2012-07-16T15:16:13.468-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326",
- "name": "centos-6-2-v20120326",
- "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000",
- "sourceType": "RAW",
- "deprecated": {
- "state": "DELETED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20130104"
- },
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- }
- },
- {
- "kind": "compute#image",
- "id": "12894486577628239762",
- "creationTimestamp": "2012-05-21T13:15:37.215-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120503",
- "name": "centos-6-2-v20120503",
- "description": "CentOS 6.2; Created Wed, 09 May 2012 11:55:54 +0000",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- }
- },
- {
- "kind": "compute#image",
- "id": "12917726455664967299",
- "creationTimestamp": "2012-06-18T11:05:30.664-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120611",
- "name": "centos-6-2-v20120611",
- "description": "CentOS 6.2; Created Mon, 11 Jun 2012 13:15:44 +0000",
- "sourceType": "RAW",
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-20130509"
- },
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- }
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list_multiple_page_2.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list_multiple_page_2.json b/google-compute-engine/src/test/resources/image_list_multiple_page_2.json
deleted file mode 100644
index b7b736a..0000000
--- a/google-compute-engine/src/test/resources/image_list_multiple_page_2.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "kind": "compute#imageList",
- "id": "projects/centos-cloud/global/images",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images",
- "nextPageToken": "CgVJTUFHRRIbZ29vZ2xlLmdjZWwtMTAtMDQtdjIwMTIxMTA2",
- "items": [
- {
- "kind": "compute#image",
- "id": "12920641029336858796",
- "creationTimestamp": "2012-06-21T22:59:56.392-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120621",
- "name": "centos-6-2-v20120621",
- "description": "CentOS 6.2; Created Thu, 21 Jun 2012 14:22:21 +0000",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- }
- },
- {
- "kind": "compute#image",
- "id": "12994279803511049620",
- "creationTimestamp": "2012-09-18T08:52:47.584-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20120912",
- "name": "centos-6-v20120912",
- "description": "CentOS 6; Created Wed, 12 Sep 2012 00:00:00 +0000",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- }
- },
- {
- "kind": "compute#image",
- "id": "13037720516378381209",
- "creationTimestamp": "2012-11-09T11:40:41.079-08:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20121106",
- "name": "centos-6-v20121106",
- "description": "SCSI-enabled CentOS 6; Created Tue, 06 Nov 2012 00:00:00 +0000",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- }
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/image_list_single_page.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/image_list_single_page.json b/google-compute-engine/src/test/resources/image_list_single_page.json
deleted file mode 100644
index 1bf13ba..0000000
--- a/google-compute-engine/src/test/resources/image_list_single_page.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "kind": "compute#imageList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images",
- "id": "projects/centos-cloud/global/images",
- "items": [
- {
-
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20131120",
- "id": "11748647391859510935",
- "creationTimestamp": "2013-11-25T15:13:50.611-08:00",
- "name": "centos-6-v20131120",
- "description": "SCSI-enabled CentOS 6 built on 2013-11-20",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://content.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140318"
- },
- "status": "READY",
- "archiveSizeBytes": "269993565",
- "diskSizeGb": "10"
- },
- {
-
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140318",
- "id": "11743140967858608122",
- "creationTimestamp": "2014-03-19T15:01:13.388-07:00",
- "name": "centos-6-v20140318",
- "description": "CentOS 6.5 x86_64 built on 2014-03-18",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://content.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140408"
- },
- "status": "READY",
- "archiveSizeBytes": "341230444",
- "diskSizeGb": "10"
- },
- {
-
- "kind": "compute#image",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140408",
- "id": "18033188469723077298",
- "creationTimestamp": "2014-04-09T10:31:57.518-07:00",
- "name": "centos-6-v20140408",
- "description": "CentOS 6.5 x86_64 built on 2014-04-08",
- "sourceType": "RAW",
- "rawDisk": {
- "source": "",
- "containerType": "TAR"
- },
- "deprecated": {
- "state": "DEPRECATED",
- "replacement": "https://content.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20140415"
- },
- "status": "READY",
- "archiveSizeBytes": "342252847",
- "diskSizeGb": "10"
- }
- ],
- "nextPageToken": "CkcIjf6H7sqqwgI6PAoCGAEKAiAACgIYAgoHIJT6lOrjDQoCGAYKFCoSY2VudG9zLTYtdjIwMTQwNDA4CgsgsrWOzOirsKH6AQ=="
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_add_access_config.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_add_access_config.json b/google-compute-engine/src/test/resources/instance_add_access_config.json
deleted file mode 100644
index cee3131..0000000
--- a/google-compute-engine/src/test/resources/instance_add_access_config.json
+++ /dev/null
@@ -1,11 +0,0 @@
-POST https://www.googleapis.com/compute/v1/projects/party-gce/zones/us-central1-a/instances/test-instance/addAccessConfig?network_interface=nic0&key={YOUR_API_KEY}
-
-Content-Type: application/json
-Authorization: Bearer ya29.AHES6ZRyNKVHwnMPUvZitAuA8mR8b0lcWh1bMI5UQ5bgsJ4j
-X-JavaScript-User-Agent: Google APIs Explorer
-
-{
-"name": "config1",
-"natIP": "10.0.1.1",
-"type": "ONE_TO_ONE_NAT"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_attach_disk.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_attach_disk.json b/google-compute-engine/src/test/resources/instance_attach_disk.json
deleted file mode 100644
index f7cb2cf..0000000
--- a/google-compute-engine/src/test/resources/instance_attach_disk.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "type": "PERSISTENT",
- "mode": "READ_WRITE",
- "deviceName": "test",
- "source": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "boot": true,
- "autoDelete": true,
- "initializeParams": {
- "diskName": "test",
- "sourceImage": "https://www.googleapis.com/compute/v1/projects/party/global/images/test",
- "diskSizeGb": 100,
- "diskType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/diskTypes/pd-standard"
- },
- "licenses": [
- "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12"
- ],
- "interface": "NVME"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_get.json b/google-compute-engine/src/test/resources/instance_get.json
deleted file mode 100644
index 7da215d..0000000
--- a/google-compute-engine/src/test/resources/instance_get.json
+++ /dev/null
@@ -1,74 +0,0 @@
-{
- "kind": "compute#instance",
- "id": "13051190678907570425",
- "description": "desc",
- "creationTimestamp": "2012-11-25T23:48:20.758",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-0",
- "name": "test-0",
- "machineType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "status": "RUNNING",
- "canIpForward": true,
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "networkInterfaces": [
- {
- "kind": "compute#instanceNetworkInterface",
- "name": "nic0",
- "networkIP": "10.240.121.115",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default"
- }
- ],
- "disks": [
- {
- "kind": "compute#instanceDisk",
- "type": "PERSISTENT",
- "mode": "READ_WRITE",
- "deviceName": "test",
- "source": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "index": 0,
- "boot": true,
- "initializeParams": {
- "diskName": "test",
- "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718",
- "diskSizeGb": "100",
- "diskType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/diskTypes/pd-standard"
- },
- "licenses": [
- "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12"
- ],
- "interface": "NVME"
- }
- ],
- "serviceAccounts": [
- {
- "kind": "compute#serviceAccount",
- "email": "default",
- "scopes": [
- "myscope"
- ]
- }
- ],
- "metadata": {
- "items": [
- {
- "key": "aKey",
- "value": "aValue"
- },
- {
- "key": "jclouds-delete-boot-disk",
- "value": "true"
- }
- ],
- "fingerprint": "efgh"
- },
- "tags": {
- "items": [
- "aTag",
- "Group-port-42"
- ],
- "fingerprint": "abcd"
- },
- "scheduling": {
- "onHostMaintenance": "MIGRATE",
- "automaticRestart": false
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_insert.json b/google-compute-engine/src/test/resources/instance_insert.json
deleted file mode 100644
index cc86f84..0000000
--- a/google-compute-engine/src/test/resources/instance_insert.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "machineType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "name": "test-1",
- "networkInterfaces": [
- {
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "accessConfigs": [
- {
- "type": "ONE_TO_ONE_NAT"
- }
- ]
- }
- ],
- "disks": [
- {
- "type": "PERSISTENT",
- "source": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "boot": true,
- "autoDelete": false
- }
- ],
- "description": "desc",
- "tags": {
- "items": []
- },
- "metadata": {
- "items": [
- {
- "key": "aKey",
- "value": "aValue"
- }
- ]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_insert_2.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_insert_2.json b/google-compute-engine/src/test/resources/instance_insert_2.json
deleted file mode 100644
index 012e172..0000000
--- a/google-compute-engine/src/test/resources/instance_insert_2.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "machineType": "%s",
- "name": "test-1",
- "networkInterfaces": [
- {
- "network": "https://www.googleapis.com/compute/v1/projects/party/networks/default",
- "accessConfigs": [
- {
- "type": "ONE_TO_ONE_NAT"
- }
- ]
- }
- ],
- "disks": [
- {
- "type": "PERSISTENT",
- "initializeParams": {
- "sourceImage": "%s"
- },
- "boot": true,
- "autoDelete": true
- }
- ],
- "description": "test",
- "tags": {
- "items": [
- "aTag",
- "jclouds-test-65f"
- ]
- },
- "metadata": {
- "items": [
- {
- "key": "jclouds-group",
- "value": "test"
- }
- ]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_insert_full.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_insert_full.json b/google-compute-engine/src/test/resources/instance_insert_full.json
deleted file mode 100644
index 61302df..0000000
--- a/google-compute-engine/src/test/resources/instance_insert_full.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "test-1",
- "machineType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "canIpForward": true,
- "networkInterfaces": [
- {
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "accessConfigs": [
- {
- "type": "ONE_TO_ONE_NAT"
- }
- ]
- }
- ],
- "disks": [
- {
- "type": "PERSISTENT",
- "source": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "boot": true,
- "autoDelete": false
- }
- ],
- "description": "desc",
- "tags": {
- "items": []
- },
- "metadata": {
- "items": [
- {
- "key": "aKey",
- "value": "aValue"
- }
- ]
- },
- "serviceAccounts": [
- {
- "email": "default",
- "scopes": [
- "https://www.googleapis.com/auth/compute"
- ]
- }
- ],
- "scheduling": {
- "onHostMaintenance": "MIGRATE",
- "automaticRestart": true
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_insert_simple.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_insert_simple.json b/google-compute-engine/src/test/resources/instance_insert_simple.json
deleted file mode 100644
index 4012c0f..0000000
--- a/google-compute-engine/src/test/resources/instance_insert_simple.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "test-1",
- "machineType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "networkInterfaces": [
- {
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "accessConfigs": [
- {
- "type": "ONE_TO_ONE_NAT"
- }
- ]
- }
- ],
- "disks": [
- {
- "type": "PERSISTENT",
- "initializeParams": {
- "sourceImage": "https://www.googleapis.com/compute/v1/projects/party/global/images/centos-6-2-v20120326"
- },
- "boot": true,
- "autoDelete": true
- }
- ],
- "tags": {
- "items": []
- },
- "metadata": {
- "items": []
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_insert_ssd.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_insert_ssd.json b/google-compute-engine/src/test/resources/instance_insert_ssd.json
deleted file mode 100644
index 7a5080d..0000000
--- a/google-compute-engine/src/test/resources/instance_insert_ssd.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "machineType": "%s",
- "name": "test-1",
- "networkInterfaces": [
- {
- "network": "https://www.googleapis.com/compute/v1/projects/party/networks/default",
- "accessConfigs": [
- {
- "type": "ONE_TO_ONE_NAT"
- }
- ]
- }
- ],
- "disks": [
- {
- "type": "PERSISTENT",
- "initializeParams": {
- "sourceImage": "%s",
- "diskType": "https://content.googleapis.com/compute/v1/projects/party/zones/us-central1-a/diskTypes/pd-ssd"
- },
- "boot": true,
- "autoDelete": true
- }
- ],
- "description": "test",
- "tags": {
- "items": [
- "aTag",
- "jclouds-test-65f"
- ]
- },
- "metadata": {
- "items": [
- {
- "key": "jclouds-group",
- "value": "test"
- }
- ]
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_list.json b/google-compute-engine/src/test/resources/instance_list.json
deleted file mode 100644
index 5a068fc..0000000
--- a/google-compute-engine/src/test/resources/instance_list.json
+++ /dev/null
@@ -1,81 +0,0 @@
-{
- "kind": "compute#instanceList",
- "id": "projects/party/zones/us-central1-a/instances",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances",
- "items": [
- {
- "kind": "compute#instance",
- "id": "13051190678907570425",
- "description": "desc",
- "creationTimestamp": "2012-11-25T23:48:20.758",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-0",
- "name": "test-0",
- "machineType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "status": "RUNNING",
- "canIpForward": true,
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "networkInterfaces": [
- {
- "kind": "compute#instanceNetworkInterface",
- "name": "nic0",
- "networkIP": "10.240.121.115",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default"
- }
- ],
- "disks": [
- {
- "kind": "compute#instanceDisk",
- "type": "PERSISTENT",
- "mode": "READ_WRITE",
- "deviceName": "test",
- "source": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "index": 0,
- "boot": true,
- "initializeParams": {
- "diskName": "test",
- "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718",
- "diskSizeGb": "100",
- "diskType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/diskTypes/pd-standard"
- },
- "licenses": [
- "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12"
- ],
- "interface": "NVME"
- }
- ],
- "serviceAccounts": [
- {
- "kind": "compute#serviceAccount",
- "email": "default",
- "scopes": [
- "myscope"
- ]
- }
- ],
- "metadata": {
- "items": [
- {
- "key": "aKey",
- "value": "aValue"
- },
- {
- "key": "jclouds-delete-boot-disk",
- "value": "true"
- }
- ],
- "fingerprint": "efgh"
- },
- "tags": {
- "items": [
- "aTag",
- "Group-port-42"
- ],
- "fingerprint": "abcd"
- },
- "scheduling": {
- "onHostMaintenance": "MIGRATE",
- "automaticRestart": false
- }
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_list_central1b_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_list_central1b_empty.json b/google-compute-engine/src/test/resources/instance_list_central1b_empty.json
deleted file mode 100644
index 97ee44c..0000000
--- a/google-compute-engine/src/test/resources/instance_list_central1b_empty.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "kind": "compute#instanceList",
- "id": "projects/party/zones/us-central1-b/instances",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-b/instances",
- "items": [ ]
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_serial_port.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_serial_port.json b/google-compute-engine/src/test/resources/instance_serial_port.json
deleted file mode 100644
index 98d9ce6..0000000
--- a/google-compute-engine/src/test/resources/instance_serial_port.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "kind": "compute#serialPortOutput",
- "contents": "console output",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-instance/serialPort"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_set_metadata.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_set_metadata.json b/google-compute-engine/src/test/resources/instance_set_metadata.json
deleted file mode 100644
index f6377eb..0000000
--- a/google-compute-engine/src/test/resources/instance_set_metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"fingerprint":"efgh","items":[{"key":"foo","value":"bar"}]}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/instance_set_tags.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/instance_set_tags.json b/google-compute-engine/src/test/resources/instance_set_tags.json
deleted file mode 100644
index e775a22..0000000
--- a/google-compute-engine/src/test/resources/instance_set_tags.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "items": [ "foo", "bar" ],
- "fingerprint": "efgh"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/license_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/license_get.json b/google-compute-engine/src/test/resources/license_get.json
deleted file mode 100644
index fffdf6c..0000000
--- a/google-compute-engine/src/test/resources/license_get.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "kind": "compute#license",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/licenses/sles-12",
- "name": "sles-12",
- "chargesUseFee": true
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/list_empty.json b/google-compute-engine/src/test/resources/list_empty.json
deleted file mode 100644
index 2666058..0000000
--- a/google-compute-engine/src/test/resources/list_empty.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "kind": "compute#forwardingRuleList",
- "id": "projects/jclouds-dev/regions/asia-east1/forwardingRules",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/jclouds-dev/regions/asia-east1/forwardingRules"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/logback.xml b/google-compute-engine/src/test/resources/logback.xml
deleted file mode 100644
index 864a5a5..0000000
--- a/google-compute-engine/src/test/resources/logback.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.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.
-
--->
-<configuration scan="false">
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-wire.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <appender name="COMPUTEFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-compute.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <appender name="SSHFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-ssh.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <root>
- <level value="warn" />
- </root>
-
- <logger name="org.jclouds">
- <level value="TRACE" />
- <appender-ref ref="FILE" />
- </logger>
-
- <logger name="jclouds.wire">
- <level value="TRACE" />
- <appender-ref ref="WIREFILE" />
- </logger>
-
- <logger name="jclouds.headers">
- <level value="TRACE" />
- <appender-ref ref="WIREFILE" />
- </logger>
-
- <logger name="jclouds.compute">
- <level value="TRACE" />
- <appender-ref ref="COMPUTEFILE" />
- </logger>
-
- <logger name="jclouds.ssh">
- <level value="TRACE" />
- <appender-ref ref="SSHFILE" />
- </logger>
-
-</configuration>
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/machinetype.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/machinetype.json b/google-compute-engine/src/test/resources/machinetype.json
deleted file mode 100644
index 73f71ad..0000000
--- a/google-compute-engine/src/test/resources/machinetype.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "kind": "compute#machineType",
- "id": "12907738072351752276",
- "creationTimestamp": "2012-06-07T20:48:14.670",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "name": "n1-standard-1",
- "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk",
- "guestCpus": 1,
- "memoryMb": 3840,
- "scratchDisks": [
- {
- "diskGb": 1770
- },
- {
- "diskGb": 1770
- }
- ],
- "maximumPersistentDisks": 16,
- "maximumPersistentDisksSizeGb": "128",
- "zone": "us-central1-a"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/machinetype_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/machinetype_list.json b/google-compute-engine/src/test/resources/machinetype_list.json
deleted file mode 100644
index 3d3ba93..0000000
--- a/google-compute-engine/src/test/resources/machinetype_list.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "kind": "compute#machineTypeList",
- "id": "projects/party/machineTypes",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes",
- "items": [
- {
- "kind": "compute#machineType",
- "id": "4618642685664990776",
- "creationTimestamp": "2013-04-25T13:32:49.088-07:00",
- "name": "f1-micro",
- "description": "1 vCPU (shared physical core) and 0.6 GB RAM",
- "guestCpus": 1,
- "memoryMb": 614,
- "maximumPersistentDisks": 4,
- "maximumPersistentDisksSizeGb": "3072",
- "zone": "us-central1-a",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/f1-micro"
- },
- {
- "kind": "compute#machineType",
- "id": "12907738072351752276",
- "creationTimestamp": "2012-06-07T20:48:14.670",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "name": "n1-standard-1",
- "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk",
- "guestCpus": 1,
- "memoryMb": 3840,
- "maximumPersistentDisks": 16,
- "maximumPersistentDisksSizeGb": "128",
- "zone": "us-central1-a"
- },
- {
- "kind": "compute#machineType",
- "id": "12908560709887590691",
- "creationTimestamp": "2012-06-07T20:51:19.936",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-8-d",
- "name": "n1-standard-8-d",
- "description": "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks",
- "guestCpus": 8,
- "memoryMb": 30720,
- "scratchDisks": [
- {
- "diskGb": 1770
- },
- {
- "diskGb": 1770
- }
- ],
- "maximumPersistentDisks": 16,
- "maximumPersistentDisksSizeGb": "1024",
- "zone": "us-central1-a"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/metadata.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/metadata.json b/google-compute-engine/src/test/resources/metadata.json
deleted file mode 100644
index 22b1826..0000000
--- a/google-compute-engine/src/test/resources/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"fingerprint":"efgh","items":[{"key":"propA","value":"valueA"},{"key":"propB","value":"valueB"}]}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/network_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/network_get.json b/google-compute-engine/src/test/resources/network_get.json
deleted file mode 100644
index ca82f69..0000000
--- a/google-compute-engine/src/test/resources/network_get.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "kind": "compute#network",
- "id": "13024414170909937976",
- "creationTimestamp": "2012-10-24T20:13:19.967",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/networks/jclouds-test",
- "name": "jclouds-test",
- "description": "A custom network for the project",
- "IPv4Range": "10.0.0.0/8",
- "gatewayIPv4": "10.0.0.1"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/network_get_default.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/network_get_default.json b/google-compute-engine/src/test/resources/network_get_default.json
deleted file mode 100644
index 55b322c..0000000
--- a/google-compute-engine/src/test/resources/network_get_default.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "kind": "compute#network",
- "id": "13024414170909937976",
- "creationTimestamp": "2012-10-24T20:13:19.967",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/networks/default",
- "name": "default",
- "description": "Default network for the project",
- "IPv4Range": "10.0.0.0/8",
- "gatewayIPv4": "10.0.0.1"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/network_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/network_insert.json b/google-compute-engine/src/test/resources/network_insert.json
deleted file mode 100644
index 55e8331..0000000
--- a/google-compute-engine/src/test/resources/network_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"test-network","IPv4Range":"10.0.0.0/8"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/network_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/network_list.json b/google-compute-engine/src/test/resources/network_list.json
deleted file mode 100644
index ed2273b..0000000
--- a/google-compute-engine/src/test/resources/network_list.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "kind": "compute#networkList",
- "id": "projects/party/networks",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/networks",
- "items": [
- {
-
- "kind": "compute#network",
- "id": "13024414170909937976",
- "creationTimestamp": "2012-10-24T20:13:19.967",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/networks/jclouds-test",
- "name": "jclouds-test",
- "description": "A custom network for the project",
- "IPv4Range": "10.0.0.0/8",
- "gatewayIPv4": "10.0.0.1"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/operation.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/operation.json b/google-compute-engine/src/test/resources/operation.json
deleted file mode 100644
index 74b7b6f..0000000
--- a/google-compute-engine/src/test/resources/operation.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-1",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert",
- "error": {
- "errors": [
- {
- "code": "INVALID_FIELD_VALUE",
- "message": "Invalid value for field 'resource.urlMaps': 'projects/party/global/urlMaps/target-http-proxy-api-live-test-url-map-2'. Resource was not found."
- }
- ]
- },
- "warnings": [
- {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "This is an example warning",
- "data": [
- {
- "key": "scope",
- "value": "There are no results for scope 'zones/asia-east1-b' on this page."
- }
- ]
- }
- ],
- "httpErrorStatusCode": 400,
- "httpErrorMessage": "BAD REQUEST",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/operation_error.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/operation_error.json b/google-compute-engine/src/test/resources/operation_error.json
deleted file mode 100644
index f6067b7..0000000
--- a/google-compute-engine/src/test/resources/operation_error.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-1",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "httpErrorStatusCode": 400,
- "httpErrorMessage": "BAD REQUEST",
- "error": {
- "errors": [
- {
- "code": "RESOURCE_ALREADY_EXISTS",
- "message": "The resource 'projects/party/zones/us-central1-a/instances/test-1' already exists"
- }
- ]
- },
- "operationType": "insert",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/operation_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/operation_list.json b/google-compute-engine/src/test/resources/operation_list.json
deleted file mode 100644
index ee4b5ec..0000000
--- a/google-compute-engine/src/test/resources/operation_list.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "kind": "compute#operationList",
- "id": "projects/party/operations",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/operations",
- "items": [
- {
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-1",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/project.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/project.json b/google-compute-engine/src/test/resources/project.json
deleted file mode 100644
index 24ac767..0000000
--- a/google-compute-engine/src/test/resources/project.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "kind": "compute#project",
- "id": "13024414184846275913",
- "creationTimestamp": "2012-10-24T20:13:16.252",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/761326798069",
- "name": "party",
- "description": "",
- "commonInstanceMetadata": {
- "kind": "compute#metadata",
- "items": [
- {
- "key": "propA",
- "value": "valueA"
- },
- {
- "key": "propB",
- "value": "valueB"
- }
- ],
- "fingerprint": "efgh"
- },
- "quotas": [
- {
- "metric": "INSTANCES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "CPUS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "EPHEMERAL_ADDRESSES",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS",
- "usage": 0,
- "limit": 8
- },
- {
- "metric": "DISKS_TOTAL_GB",
- "usage": 0,
- "limit": 100
- },
- {
- "metric": "SNAPSHOTS",
- "usage": 0,
- "limit": 1000
- },
- {
- "metric": "NETWORKS",
- "usage": 1,
- "limit": 5
- },
- {
- "metric": "FIREWALLS",
- "usage": 2,
- "limit": 100
- },
- {
- "metric": "IMAGES",
- "usage": 0,
- "limit": 100
- }
- ],
- "usageExportLocation": {
- "bucketName": "test-bucket",
- "reportNamePrefix": "report-prefix"
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/quota.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/quota.json b/google-compute-engine/src/test/resources/quota.json
deleted file mode 100644
index b631ab3..0000000
--- a/google-compute-engine/src/test/resources/quota.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "metric": "INSTANCES",
- "usage": 0,
- "limit": 8
-}
\ No newline at end of file
[04/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/SimpleParsingTests.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/SimpleParsingTests.java b/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/SimpleParsingTests.java
deleted file mode 100644
index 3b13193..0000000
--- a/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/SimpleParsingTests.java
+++ /dev/null
@@ -1,82 +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.parse;
-
-import static org.jclouds.googlecomputeengine.compute.strategy.CreateNodesWithGroupEncodedIntoNameThenAddToSet.simplifyPorts;
-import static org.jclouds.googlecomputeengine.compute.strategy.CreateNodesWithGroupEncodedIntoNameThenAddToSet.nameFromNetworkString;
-
-import java.util.List;
-
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-
-import static org.testng.Assert.assertEquals;
-
-
-@Test(groups = "unit", testName = "SimpleParsingTests", singleThreaded = true)
-public class SimpleParsingTests {
-
- public void testOnePort(){
- int[] ports = {22};
- List<String> output = simplifyPorts(ports);
-
- assertEquals(ImmutableList.of("22"), output);
- }
-
- public void testBasic(){
- int[] ports = {1, 2, 3, 4};
- List<String> output = simplifyPorts(ports);
-
- assertEquals(ImmutableList.of("1-4"), output);
- }
-
- public void testComplex(){
- int[] ports = {3, 1, 5, 2, 1002, 17, 1001, 22, 80, 1000};
- List<String> output = simplifyPorts(ports);
-
- assertEquals(ImmutableList.of("1-3", "5", "17", "22", "80", "1000-1002"), output);
- }
-
- public void testEmpty(){
- int[] ports = {};
- List<String> output = simplifyPorts(ports);
-
- assertEquals(null, output);
- }
-
- public void testEndSingle(){
- int[] ports = {1, 2, 3, 4, 7};
- List<String> output = simplifyPorts(ports);
-
- assertEquals(ImmutableList.of("1-4", "7"), output);
- }
-
- public void testNetworkFromString(){
- String network = "https://www.googleapis.com/compute/v1/projects/project/global/networks/network";
- assertEquals("network", nameFromNetworkString(network));
-
- network = "projects/project/global/networks/network";
- assertEquals("network", nameFromNetworkString(network));
-
- network = "global/networks/default";
- assertEquals("default", nameFromNetworkString(network));
-
- network = "default";
- assertEquals("default", nameFromNetworkString(network));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/address_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/address_get.json b/google-compute-engine/src/test/resources/address_get.json
deleted file mode 100644
index e7663e6..0000000
--- a/google-compute-engine/src/test/resources/address_get.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "kind": "compute#address",
- "id": "4439373783165447583",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "status": "IN_USE",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "name": "test-ip1",
- "description": "",
- "address": "173.255.115.190",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-ip1",
- "users": [
- "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1-a/forwardingRules/test-forwarding-rule"
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/address_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/address_insert.json b/google-compute-engine/src/test/resources/address_insert.json
deleted file mode 100644
index 4bccf63..0000000
--- a/google-compute-engine/src/test/resources/address_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"test-ip1"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/address_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/address_list.json b/google-compute-engine/src/test/resources/address_list.json
deleted file mode 100644
index 7f9d171..0000000
--- a/google-compute-engine/src/test/resources/address_list.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "kind": "compute#addressList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses",
- "id": "projects/party/regions/us-central1/addresses",
- "items": [
- {
- "kind": "compute#address",
- "id": "4439373783165447583",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "status": "IN_USE",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "name": "test-ip1",
- "description": "",
- "address": "173.255.115.190",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-ip1",
- "users": [
- "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1-a/forwardingRules/test-forwarding-rule"
- ]
- },
- {
- "kind": "compute#address",
- "id": "4881363978908129158",
- "creationTimestamp": "2013-07-26T14:08:21.552-07:00",
- "status": "RESERVED",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "name": "test-ip2",
- "description": "",
- "address": "173.255.118.115",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-ip2"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_address_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_address_list.json b/google-compute-engine/src/test/resources/aggregated_address_list.json
deleted file mode 100644
index d461879..0000000
--- a/google-compute-engine/src/test/resources/aggregated_address_list.json
+++ /dev/null
@@ -1,131 +0,0 @@
-{
- "kind": "compute#addressAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/addresses",
- "id": "projects/party/aggregated/addresses",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "addresses": [
- {
-
- "kind": "compute#address",
- "id": "4439373783165447583",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "status": "RESERVED",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "name": "test-ip1",
- "description": "",
- "address": "173.255.115.190",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-ip1"
- },
- {
-
- "kind": "compute#address",
- "id": "4881363978908129158",
- "creationTimestamp": "2013-07-26T14:08:21.552-07:00",
- "status": "RESERVED",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "name": "test-ip2",
- "description": "",
- "address": "173.255.118.115",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/addresses/test-ip2"
- }
- ]
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_address_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_address_list_empty.json b/google-compute-engine/src/test/resources/aggregated_address_list_empty.json
deleted file mode 100644
index 22f407d..0000000
--- a/google-compute-engine/src/test/resources/aggregated_address_list_empty.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "kind": "compute#addressAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/addresses",
- "id": "projects/party/aggregated/addresses",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-a"
- }
- ]
- }
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_disk_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_disk_list.json b/google-compute-engine/src/test/resources/aggregated_disk_list.json
deleted file mode 100644
index 599e23d..0000000
--- a/google-compute-engine/src/test/resources/aggregated_disk_list.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "kind": "compute#diskAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/disks",
- "id": "projects/party/aggregated/disks",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "disks": [
- {
- "kind": "compute#disk",
- "id": "13050421646334304115",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/testimage1",
- "name": "testimage1",
- "sizeGb": "1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "status": "READY",
- "type": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard"
- }
- ]
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_disk_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_disk_list_empty.json b/google-compute-engine/src/test/resources/aggregated_disk_list_empty.json
deleted file mode 100644
index d74d3e0..0000000
--- a/google-compute-engine/src/test/resources/aggregated_disk_list_empty.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "kind": "compute#diskAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/disks",
- "id": "projects/party/aggregated/disks",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-a"
- }
- ]
- }
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_disktype_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_disktype_list.json b/google-compute-engine/src/test/resources/aggregated_disktype_list.json
deleted file mode 100644
index 12a9e33..0000000
--- a/google-compute-engine/src/test/resources/aggregated_disktype_list.json
+++ /dev/null
@@ -1,127 +0,0 @@
-{
- "kind": "compute#diskTypeAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/diskTypes",
- "id": "projects/party/aggregated/diskTypes",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "diskTypes": [
- {
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.530-07:00",
- "name": "pd-standard",
- "description": "Standard Persistent Disk",
- "validDiskSize": "10GB-10TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard",
- "defaultDiskSizeGb": "500"
- },
- {
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.529-07:00",
- "name": "pd-ssd",
- "description": "SSD Persistent Disk",
- "validDiskSize": "10GB-1TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-ssd",
- "defaultDiskSizeGb": "100"
- }
- ]
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_disktype_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_disktype_list_empty.json b/google-compute-engine/src/test/resources/aggregated_disktype_list_empty.json
deleted file mode 100644
index cd5e22c..0000000
--- a/google-compute-engine/src/test/resources/aggregated_disktype_list_empty.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "kind": "compute#diskTypeAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/diskTypes",
- "id": "projects/party/aggregated/diskTypes",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-a"
- }
- ]
- }
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list.json b/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list.json
deleted file mode 100644
index 2beb18b..0000000
--- a/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "kind": "compute#forwardingRuleAggregatedList",
- "id": "projects/party/aggregated/forwardingRules",
- "items": {
- "regions/asia-east1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/asia-east1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/asia-east1"
- }
- ]
- }
- },
- "regions/europe-west1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/europe-west1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/europe-west1"
- }
- ]
- }
- },
- "regions/us-central1": {
- "forwardingRules": [
- {
-
- "kind": "compute#forwardingRule",
- "id": "943206052144235641",
- "creationTimestamp": "2014-11-24T15:33:26.664-08:00",
- "name": "test-forwarding-rule",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "IPAddress": "130.211.140.61",
- "IPProtocol": "TCP",
- "portRange": "1-65535",
- "target": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/targetPools/test",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/forwardingRules/test-forwarding-rule"
- }
- ]
- },
- "global": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'global' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "global"
- }
- ]
- }
- }
- },
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/forwardingRules"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list_empty.json b/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list_empty.json
deleted file mode 100644
index c924b99..0000000
--- a/google-compute-engine/src/test/resources/aggregated_forwarding_rule_list_empty.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "kind": "compute#forwardingRuleAggregatedList",
- "id": "projects/party/aggregated/forwardingRules",
- "items": {
- "regions/asia-east1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/asia-east1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/asia-east1"
- }
- ]
- }
- },
- "regions/europe-west1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/europe-west1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/europe-west1"
- }
- ]
- }
- },
- "regions/us-central1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/us-central1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/us-central1"
- }
- ]
- }
- },
- "global": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'global' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "global"
- }
- ]
- }
- }
- },
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/forwardingRules"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_global_operation_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_global_operation_list.json b/google-compute-engine/src/test/resources/aggregated_global_operation_list.json
deleted file mode 100644
index 2ef24b5..0000000
--- a/google-compute-engine/src/test/resources/aggregated_global_operation_list.json
+++ /dev/null
@@ -1,99 +0,0 @@
-{
- "kind": "compute#operationAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/operations",
- "id": "projects/party/aggregated/operations",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "operations": [
- {
- "kind": "compute#operation",
- "id": "13053095055850848306",
- "creationTimestamp": "2013-07-26T13:57:20.204-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/operations/operation-1354084865060",
- "name": "operation-1354084865060",
- "targetLink": "https://www.googleapis.com/compute/v1/projects/party/global/firewalls/jclouds-test-delete",
- "targetId": "13053094017547040099",
- "status": "DONE",
- "user": "user@developer.gserviceaccount.com",
- "progress": 100,
- "insertTime": "2012-11-28T06:41:05.060",
- "startTime": "2012-11-28T06:41:05.142",
- "endTime": "2012-11-28T06:41:06.142",
- "operationType": "insert"
- }
- ]
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_global_operation_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_global_operation_list_empty.json b/google-compute-engine/src/test/resources/aggregated_global_operation_list_empty.json
deleted file mode 100644
index 09d0414..0000000
--- a/google-compute-engine/src/test/resources/aggregated_global_operation_list_empty.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "kind": "compute#operationAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/operations",
- "id": "projects/party/aggregated/operations",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-a"
- }
- ]
- }
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_instance_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_instance_list.json b/google-compute-engine/src/test/resources/aggregated_instance_list.json
deleted file mode 100644
index d50f1c5..0000000
--- a/google-compute-engine/src/test/resources/aggregated_instance_list.json
+++ /dev/null
@@ -1,174 +0,0 @@
-{
- "kind": "compute#instanceAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/instances",
- "id": "projects/party/aggregated/instances",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "instances": [
- {
- "kind": "compute#instance",
- "id": "13051190678907570425",
- "description": "desc",
- "creationTimestamp": "2012-11-25T23:48:20.758",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/test-0",
- "name": "test-0",
- "machineType": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "status": "RUNNING",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "networkInterfaces": [
- {
- "kind": "compute#instanceNetworkInterface",
- "name": "nic0",
- "networkIP": "10.240.121.115",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default"
- }
- ],
- "disks": [
- {
- "kind": "compute#instanceDisk",
- "type": "PERSISTENT",
- "mode": "READ_WRITE",
- "deviceName": "test",
- "source": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "index": 0,
- "boot": true
- }
- ],
- "serviceAccounts": [
- {
- "kind": "compute#serviceAccount",
- "email": "default",
- "scopes": [
- "myscope"
- ]
- }
- ],
- "metadata": {
- "items": [
- {
- "key": "aKey",
- "value": "aValue"
- },
- {
- "key": "jclouds-image",
- "value": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718"
- },
- {
- "key": "jclouds-delete-boot-disk",
- "value": "true"
- }
- ],
- "fingerprint": "efgh"
- },
- "tags": {
- "items": [
- "aTag",
- "Group-port-42"
- ],
- "fingerprint": "abcd"
- },
- "scheduling": {
- "onHostMaintenance": "MIGRATE",
- "automaticRestart": false
- }
- }
- ]
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_instance_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_instance_list_empty.json b/google-compute-engine/src/test/resources/aggregated_instance_list_empty.json
deleted file mode 100644
index 8cc7c2f..0000000
--- a/google-compute-engine/src/test/resources/aggregated_instance_list_empty.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "kind": "compute#instanceAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/instances",
- "id": "projects/party/aggregated/instances",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-a"
- }
- ]
- }
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_machinetype_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_machinetype_list.json b/google-compute-engine/src/test/resources/aggregated_machinetype_list.json
deleted file mode 100644
index f9ae87c..0000000
--- a/google-compute-engine/src/test/resources/aggregated_machinetype_list.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "kind": "compute#machineTypeAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/machineTypes",
- "id": "projects/party/aggregated/machineTypes",
- "items": {
- "zones/us-central1-a": {
- "machineTypes": [
- {
- "kind": "compute#machineType",
- "id": "4618642685664990776",
- "creationTimestamp": "2013-04-25T13:32:49.088-07:00",
- "name": "f1-micro",
- "description": "1 vCPU (shared physical core) and 0.6 GB RAM",
- "guestCpus": 1,
- "memoryMb": 614,
- "maximumPersistentDisks": 4,
- "maximumPersistentDisksSizeGb": "3072",
- "zone": "us-central1-a",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/f1-micro"
- },
- {
- "kind": "compute#machineType",
- "id": "12907738072351752276",
- "creationTimestamp": "2012-06-07T20:48:14.670",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-1",
- "name": "n1-standard-1",
- "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk",
- "guestCpus": 1,
- "memoryMb": 3840,
- "maximumPersistentDisks": 16,
- "maximumPersistentDisksSizeGb": "128",
- "zone": "us-central1-a"
- },
- {
- "kind": "compute#machineType",
- "id": "12908560709887590691",
- "creationTimestamp": "2012-06-07T20:51:19.936",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/machineTypes/n1-standard-8-d",
- "name": "n1-standard-8-d",
- "description": "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks",
- "guestCpus": 8,
- "memoryMb": 30720,
- "scratchDisks": [
- {
- "diskGb": 1770
- },
- {
- "diskGb": 1770
- }
- ],
- "maximumPersistentDisks": 16,
- "maximumPersistentDisksSizeGb": "1024",
- "zone": "us-central1-a"
- }
- ]
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_target_instance_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_target_instance_list.json b/google-compute-engine/src/test/resources/aggregated_target_instance_list.json
deleted file mode 100644
index e1e56b9..0000000
--- a/google-compute-engine/src/test/resources/aggregated_target_instance_list.json
+++ /dev/null
@@ -1,128 +0,0 @@
-{
- "kind": "compute#targetInstanceAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/targetInstances",
- "id": "projects/party/aggregated/targetInstances",
- "items": {
- "zones/asia-east1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-a"
- }
- ]
- }
- },
- "zones/asia-east1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-b"
- }
- ]
- }
- },
- "zones/asia-east1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/asia-east1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/asia-east1-c"
- }
- ]
- }
- },
- "zones/europe-west1-a": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-a' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-a"
- }
- ]
- }
- },
- "zones/europe-west1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-b"
- }
- ]
- }
- },
- "zones/europe-west1-c": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/europe-west1-c' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/europe-west1-c"
- }
- ]
- }
- },
- "zones/us-central1-a": {
- "targetInstances": [
- {
-
- "kind": "compute#targetInstance",
- "id": "3191835352771895826",
- "creationTimestamp": "2014-11-24T10:42:45.135-08:00",
- "name": "test-target-instance",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "natPolicy": "NO_NAT",
- "instance": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/instances/instance-1",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/targetInstances/test-target-instance"
- },
- {
-
- "kind": "compute#targetInstance",
- "id": "7362436693678237415",
- "creationTimestamp": "2014-11-20T17:35:17.268-08:00",
- "name": "target-instance-1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "natPolicy": "NO_NAT",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/targetInstances/target-instance-1"
- }
- ]
- },
- "zones/us-central1-b": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-b' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-b"
- }
- ]
- }
- },
- "zones/us-central1-f": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'zones/us-central1-f' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "zones/us-central1-f"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_target_instance_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_target_instance_list_empty.json b/google-compute-engine/src/test/resources/aggregated_target_instance_list_empty.json
deleted file mode 100644
index e1a852c..0000000
--- a/google-compute-engine/src/test/resources/aggregated_target_instance_list_empty.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "kind": "compute#addressAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/studied-point-720/aggregated/addresses",
- "id": "projects/studied-point-720/aggregated/addresses",
- "items": {
- "regions/asia-east1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/asia-east1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/asia-east1"
- }
- ]
- }
- },
- "regions/europe-west1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/europe-west1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/europe-west1"
- }
- ]
- }
- },
- "regions/us-central1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/us-central1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/us-central1"
- }
- ]
- }
- },
- "global": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'global' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "global"
- }
- ]
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_target_pool_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_target_pool_list.json b/google-compute-engine/src/test/resources/aggregated_target_pool_list.json
deleted file mode 100644
index 60fc7c6..0000000
--- a/google-compute-engine/src/test/resources/aggregated_target_pool_list.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "kind": "compute#targetPoolAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/targetPools",
- "id": "projects/party/aggregated/targetPools",
- "items": {
- "regions/asia-east1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/asia-east1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/asia-east1"
- }
- ]
- }
- },
- "regions/europe-west1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/europe-west1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/europe-west1"
- }
- ]
- }
- },
- "regions/us-central1": {
- "targetPools": [
- {
-
- "kind": "compute#targetPool",
- "id": "17592955481805765508",
- "creationTimestamp": "2014-12-01T11:51:15.611-08:00",
- "name": "test",
- "description": "a Pool!",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1",
- "sessionAffinity": "NONE",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/us-central1/targetPools/test"
- }
- ]
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/aggregated_target_pool_list_empty.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/aggregated_target_pool_list_empty.json b/google-compute-engine/src/test/resources/aggregated_target_pool_list_empty.json
deleted file mode 100644
index 9c10a7b..0000000
--- a/google-compute-engine/src/test/resources/aggregated_target_pool_list_empty.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "kind": "compute#targetPoolAggregatedList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/aggregated/targetPools",
- "id": "projects/party/aggregated/targetPools",
- "items": {
- "regions/asia-east1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/asia-east1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/asia-east1"
- }
- ]
- }
- },
- "regions/europe-west1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/europe-west1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/europe-west1"
- }
- ]
- }
- },
- "regions/us-central1": {
- "warning": {
- "code": "NO_RESULTS_ON_PAGE",
- "message": "There are no results for scope 'regions/us-central1' on this page.",
- "data": [
- {
- "key": "scope",
- "value": "regions/us-central1"
- }
- ]
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/backend_service_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/backend_service_get.json b/google-compute-engine/src/test/resources/backend_service_get.json
deleted file mode 100644
index 6551fc7..0000000
--- a/google-compute-engine/src/test/resources/backend_service_get.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "kind": "compute#backendService",
- "id": "15448612110458377529",
- "creationTimestamp": "2014-07-18T13:37:48.574-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "name": "jclouds-test",
- "description": "Backend service",
- "backends": [
- {
- "balancingMode": "UTILIZATION",
- "capacityScaler": 1.0,
- "description": "A resource view",
- "group": "https://www.googleapis.com/resourceviews/v1beta1/projects/myproject/zones/us-central1-a/resourceViews/jclouds-test",
- "maxUtilization": 0.8
- }
- ],
- "healthChecks": [
- "https://www.googleapis.com/compute/v1/projects/myproject/global/httpHealthChecks/jclouds-test"
- ],
- "port": 80,
- "protocol": "HTTP",
- "timeoutSec": 30,
- "fingerprint": "I6n5NPSXn8g="
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/backend_service_get_health_request.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/backend_service_get_health_request.json b/google-compute-engine/src/test/resources/backend_service_get_health_request.json
deleted file mode 100644
index d71f001..0000000
--- a/google-compute-engine/src/test/resources/backend_service_get_health_request.json
+++ /dev/null
@@ -1 +0,0 @@
-{"group":"https://www.googleapis.com/resourceviews/v1beta1/projects/myproject/zones/us-central1-a/resourceViews/jclouds-test"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/backend_service_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/backend_service_insert.json b/google-compute-engine/src/test/resources/backend_service_insert.json
deleted file mode 100644
index ce0b0c8..0000000
--- a/google-compute-engine/src/test/resources/backend_service_insert.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "jclouds-test",
- "healthChecks": [
- "https://www.googleapis.com/compute/v1/projects/myproject/global/httpHealthChecks/jclouds-test"
- ],
- "timeoutSec": 30,
- "port": 80,
- "protocol": "HTTP"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/backend_service_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/backend_service_list.json b/google-compute-engine/src/test/resources/backend_service_list.json
deleted file mode 100644
index d258de2..0000000
--- a/google-compute-engine/src/test/resources/backend_service_list.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "kind": "compute#backendServiceList",
- "id": "projects/myproject/backendServices",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices",
- "items": [
- {
- "kind": "compute#backendService",
- "id": "15448612110458377529",
- "creationTimestamp": "2014-07-18T13:37:48.574-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test",
- "name": "jclouds-test",
- "description": "Backend service",
- "backends": [
- {
- "balancingMode": "UTILIZATION",
- "capacityScaler": 1.0,
- "description": "A resource view",
- "group": "https://www.googleapis.com/resourceviews/v1beta1/projects/myproject/zones/us-central1-a/resourceViews/jclouds-test",
- "maxUtilization": 0.8
- }
- ],
- "healthChecks": [
- "https://www.googleapis.com/compute/v1/projects/myproject/global/httpHealthChecks/jclouds-test"
- ],
- "port": 80,
- "protocol": "HTTP",
- "timeoutSec": 30,
- "fingerprint": "I6n5NPSXn8g="
- },
- {
- "kind": "compute#backendService",
- "id": "12862241067393040785",
- "creationTimestamp": "2012-04-13T03:05:04.365",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/backendServices/jclouds-test-2",
- "name": "jclouds-test-2",
- "description": "Backend Service 2",
- "port": 80,
- "healthChecks": [
- "https://www.googleapis.com/compute/v1/projects/myproject/global/httpHealthChecks/jclouds-test"
- ],
- "protocol": "HTTP",
- "timeoutSec": 45
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disk_create_snapshot.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disk_create_snapshot.json b/google-compute-engine/src/test/resources/disk_create_snapshot.json
deleted file mode 100644
index 6499744..0000000
--- a/google-compute-engine/src/test/resources/disk_create_snapshot.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"test-snap"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disk_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disk_get.json b/google-compute-engine/src/test/resources/disk_get.json
deleted file mode 100644
index 8b3db5b..0000000
--- a/google-compute-engine/src/test/resources/disk_get.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "kind": "compute#disk",
- "id": "13050421646334304115",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/testimage1",
- "name": "testimage1",
- "sizeGb": "1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "status": "READY",
- "type": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disk_get_with_source_image.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disk_get_with_source_image.json b/google-compute-engine/src/test/resources/disk_get_with_source_image.json
deleted file mode 100644
index bca8f2b..0000000
--- a/google-compute-engine/src/test/resources/disk_get_with_source_image.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "kind": "compute#disk",
- "id": "13050421646334304115",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/test",
- "name": "test",
- "sizeGb": "1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "status": "READY",
- "type": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard",
- "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140718"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disk_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disk_insert.json b/google-compute-engine/src/test/resources/disk_insert.json
deleted file mode 100644
index 8699cdd..0000000
--- a/google-compute-engine/src/test/resources/disk_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"testimage1","sizeGb":1}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disk_insert_ssd.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disk_insert_ssd.json b/google-compute-engine/src/test/resources/disk_insert_ssd.json
deleted file mode 100644
index a8c7eb5..0000000
--- a/google-compute-engine/src/test/resources/disk_insert_ssd.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"testimage1","sizeGb":1,"type":"https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/diskTypes/pd-ssd"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disk_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disk_list.json b/google-compute-engine/src/test/resources/disk_list.json
deleted file mode 100644
index 6752144..0000000
--- a/google-compute-engine/src/test/resources/disk_list.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "kind": "compute#diskList",
- "id": "projects/party/zones/us-central1-a/disks",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks",
- "items": [
- {
- "kind": "compute#disk",
- "id": "13050421646334304115",
- "creationTimestamp": "2012-11-25T01:38:48.306",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a/disks/testimage1",
- "name": "testimage1",
- "sizeGb": "1",
- "zone": "https://www.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "status": "READY",
- "type": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disktype.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disktype.json b/google-compute-engine/src/test/resources/disktype.json
deleted file mode 100644
index d67d442..0000000
--- a/google-compute-engine/src/test/resources/disktype.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.529-07:00",
- "name": "pd-ssd",
- "description": "SSD Persistent Disk",
- "validDiskSize": "10GB-1TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-ssd",
- "defaultDiskSizeGb": "100"
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disktype_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disktype_list.json b/google-compute-engine/src/test/resources/disktype_list.json
deleted file mode 100644
index 20ed049..0000000
--- a/google-compute-engine/src/test/resources/disktype_list.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "kind": "compute#diskTypeList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes",
- "items": [
- {
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.530-07:00",
- "name": "pd-standard",
- "description": "Standard Persistent Disk",
- "validDiskSize": "10GB-10TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard",
- "defaultDiskSizeGb": "500"
- },
- {
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.529-07:00",
- "name": "pd-ssd",
- "description": "SSD Persistent Disk",
- "validDiskSize": "10GB-1TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-ssd",
- "defaultDiskSizeGb": "100"
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disktype_list_central1b.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disktype_list_central1b.json b/google-compute-engine/src/test/resources/disktype_list_central1b.json
deleted file mode 100644
index f2171ef..0000000
--- a/google-compute-engine/src/test/resources/disktype_list_central1b.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "kind": "compute#diskTypeList",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes",
- "items": [
- {
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.530-07:00",
- "name": "pd-standard",
- "description": "Standard Persistent Disk",
- "validDiskSize": "10GB-10TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/studied-point-720/zones/us-central1-a/diskTypes/pd-standard",
- "defaultDiskSizeGb": "500"
- }
- ]
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/disktype_ssd.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/disktype_ssd.json b/google-compute-engine/src/test/resources/disktype_ssd.json
deleted file mode 100644
index fcedefb..0000000
--- a/google-compute-engine/src/test/resources/disktype_ssd.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "kind": "compute#diskType",
- "creationTimestamp": "2014-06-02T11:07:28.529-07:00",
- "name": "pd-ssd",
- "description": "SSD Persistent Disk",
- "validDiskSize": "10GB-1TB",
- "zone": "https://content.googleapis.com/compute/v1/projects/party/zones/us-central1-a",
- "selfLink": "https://content.googleapis.com/compute/v1/projects/party/zones/us-central1-a/diskTypes/pd-ssd",
- "defaultDiskSizeGb": "100"
-}
-
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/firewall_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/firewall_get.json b/google-compute-engine/src/test/resources/firewall_get.json
deleted file mode 100644
index 89b4fd2..0000000
--- a/google-compute-engine/src/test/resources/firewall_get.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-
- "kind": "compute#firewall",
- "id": "12862241031274216284",
- "creationTimestamp": "2012-04-13T03:05:02.855",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/firewalls/jclouds-test",
- "name": "jclouds-test",
- "description": "Internal traffic from default allowed",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/jclouds-test",
- "sourceRanges": [
- "10.0.0.0/8"
- ],
- "allowed": [
- {
- "IPProtocol": "tcp",
- "ports": [
- "1-65535"
- ]
- },
- {
- "IPProtocol": "udp",
- "ports": [
- "1-65535"
- ]
- },
- {
- "IPProtocol": "icmp"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/firewall_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/firewall_insert.json b/google-compute-engine/src/test/resources/firewall_insert.json
deleted file mode 100644
index 6d29ef8..0000000
--- a/google-compute-engine/src/test/resources/firewall_insert.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "myfw",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/default",
- "sourceRanges": [
- "10.0.1.0/32"
- ],
- "sourceTags": [
- "tag1"
- ],
- "targetTags": [
- "tag2"
- ],
- "allowed": [
- {
- "IPProtocol": "tcp",
- "ports": [
- "22",
- "23-24"
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/firewall_insert_2.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/firewall_insert_2.json b/google-compute-engine/src/test/resources/firewall_insert_2.json
deleted file mode 100644
index 6d0ed14..0000000
--- a/google-compute-engine/src/test/resources/firewall_insert_2.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "jclouds-test-65f",
- "network": "https://www.googleapis.com/compute/v1/projects/party/networks/default",
- "sourceRanges": [
- "10.0.0.0/8",
- "0.0.0.0/0"
- ],
- "sourceTags": [
- "aTag"
- ],
- "targetTags": [
- "jclouds-test-65f"
- ],
- "allowed": [
- {
- "IPProtocol": "tcp",
- "ports": [
- "22"
- ]
- },
- {
- "IPProtocol": "udp",
- "ports": [
- "22"
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/firewall_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/firewall_list.json b/google-compute-engine/src/test/resources/firewall_list.json
deleted file mode 100644
index a98b99a..0000000
--- a/google-compute-engine/src/test/resources/firewall_list.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "kind": "compute#firewallList",
- "id": "projects/google/firewalls",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/google/global/firewalls",
- "items": [
- {
-
- "kind": "compute#firewall",
- "id": "12862241031274216284",
- "creationTimestamp": "2012-04-13T03:05:02.855",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/firewalls/jclouds-test",
- "name": "jclouds-test",
- "description": "Internal traffic from default allowed",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/jclouds-test",
- "sourceRanges": [
- "10.0.0.0/8"
- ],
- "allowed": [
- {
- "IPProtocol": "tcp",
- "ports": [
- "1-65535"
- ]
- },
- {
- "IPProtocol": "udp",
- "ports": [
- "1-65535"
- ]
- },
- {
- "IPProtocol": "icmp"
- }
- ]
- },
- {
-
- "kind": "compute#firewall",
- "id": "12862241067393040785",
- "creationTimestamp": "2012-04-13T03:05:04.365",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/google/global/firewalls/default-ssh",
- "name": "default-ssh",
- "description": "SSH allowed from anywhere",
- "network": "https://www.googleapis.com/compute/v1/projects/google/global/networks/default",
- "sourceRanges": [
- "0.0.0.0/0"
- ],
- "allowed": [
- {
- "IPProtocol": "tcp",
- "ports": [
- "22"
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/firewall_list_compute.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/firewall_list_compute.json b/google-compute-engine/src/test/resources/firewall_list_compute.json
deleted file mode 100644
index 0ad66be..0000000
--- a/google-compute-engine/src/test/resources/firewall_list_compute.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "kind": "compute#firewallList",
- "id": "projects/google/firewalls",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/google/global/firewalls",
- "items": [
- {
- "kind": "compute#firewall",
- "id": "12862241031274216284",
- "creationTimestamp": "2012-04-13T03:05:02.855",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/global/firewalls/jclouds-test-delete",
- "name": "jclouds-test-delete-34sf",
- "description": "Internal traffic from default allowed",
- "network": "https://www.googleapis.com/compute/v1/projects/party/global/networks/jclouds-test-delete",
- "sourceRanges": [
- "10.0.0.0/8"
- ],
- "allowed": [
- {
- "IPProtocol": "tcp",
- "ports": [
- "1-65535"
- ]
- },
- {
- "IPProtocol": "udp",
- "ports": [
- "1-65535"
- ]
- },
- {
- "IPProtocol": "icmp"
- }
- ]
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/forwardingrule_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/forwardingrule_get.json b/google-compute-engine/src/test/resources/forwardingrule_get.json
deleted file mode 100644
index 2bad412..0000000
--- a/google-compute-engine/src/test/resources/forwardingrule_get.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "kind": "compute#forwardingRule",
- "id": "6732523704970219884",
- "creationTimestamp": "2014-01-08T06:51:10.809-08:00",
- "name": "test-forwarding-rule",
- "region": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1",
- "IPAddress": "23.251.129.77",
- "IPProtocol": "TCP",
- "portRange": "1-65535",
- "target": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1/targetPools/test-target-pool",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1/forwardingRules/test-forwarding-rule"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/forwardingrule_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/forwardingrule_insert.json b/google-compute-engine/src/test/resources/forwardingrule_insert.json
deleted file mode 100644
index 4a335be..0000000
--- a/google-compute-engine/src/test/resources/forwardingrule_insert.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-"name": "test-forwarding-rule",
-"target": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1/targetPools/test-target-pool"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/forwardingrule_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/forwardingrule_list.json b/google-compute-engine/src/test/resources/forwardingrule_list.json
deleted file mode 100644
index 71e9450..0000000
--- a/google-compute-engine/src/test/resources/forwardingrule_list.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-"kind": "compute#forwardingRuleList",
-"selfLink": "https://content.googleapis.com/compute/v1/projects/party/regions/europe-west1/forwardingRules",
-"id": "projects/party/regions/europe-west1/forwardingRules",
-"items": [
-{
-"kind": "compute#forwardingRule",
-"id": "6732523704970219884",
-"creationTimestamp": "2014-01-08T06:51:10.809-08:00",
-"name": "test-forwarding-rule",
-"region": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1",
-"IPAddress": "23.251.129.77",
-"IPProtocol": "TCP",
-"portRange": "1-65535",
-"target": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1/targetPools/test-target-pool",
-"selfLink": "https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1/forwardingRules/test-forwarding-rule"
-}
-]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/forwardingrule_set_target.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/forwardingrule_set_target.json b/google-compute-engine/src/test/resources/forwardingrule_set_target.json
deleted file mode 100644
index d21327e..0000000
--- a/google-compute-engine/src/test/resources/forwardingrule_set_target.json
+++ /dev/null
@@ -1 +0,0 @@
-{"target":"https://www.googleapis.com/compute/v1/projects/party/regions/europe-west1/targetPools/test-target-pool"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/global_forwarding_rule_get.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/global_forwarding_rule_get.json b/google-compute-engine/src/test/resources/global_forwarding_rule_get.json
deleted file mode 100644
index e29984d..0000000
--- a/google-compute-engine/src/test/resources/global_forwarding_rule_get.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "kind": "compute#forwardingRule",
- "id": "8192211304399313984",
- "creationTimestamp": "2014-07-18T09:47:30.826-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/forwardingRules/jclouds-test",
- "name": "jclouds-test",
- "description": "tcp forwarding rule",
- "IPAddress": "107.178.255.156",
- "IPProtocol": "TCP",
- "portRange": "80-80",
- "target": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test"
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/global_forwarding_rule_insert.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/global_forwarding_rule_insert.json b/google-compute-engine/src/test/resources/global_forwarding_rule_insert.json
deleted file mode 100644
index 23e6375..0000000
--- a/google-compute-engine/src/test/resources/global_forwarding_rule_insert.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"jclouds-test","target":"https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test", "portRange":"80"}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/global_forwarding_rule_list.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/global_forwarding_rule_list.json b/google-compute-engine/src/test/resources/global_forwarding_rule_list.json
deleted file mode 100644
index 53f95db..0000000
--- a/google-compute-engine/src/test/resources/global_forwarding_rule_list.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "kind": "compute#forwardingRuleList",
- "id": "projects/myproject/global/forwardingRules",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/forwardingRules",
- "items": [
- {
- "kind": "compute#forwardingRule",
- "id": "8192211304399313984",
- "creationTimestamp": "2014-07-18T09:47:30.826-07:00",
- "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/forwardingRules/jclouds-test",
- "name": "jclouds-test",
- "description": "tcp forwarding rule",
- "IPAddress": "107.178.255.156",
- "IPProtocol": "TCP",
- "portRange": "80-80",
- "target": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/test/resources/global_forwarding_rule_setTarget.json
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/test/resources/global_forwarding_rule_setTarget.json b/google-compute-engine/src/test/resources/global_forwarding_rule_setTarget.json
deleted file mode 100644
index 4dba051..0000000
--- a/google-compute-engine/src/test/resources/global_forwarding_rule_setTarget.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "target": "https://www.googleapis.com/compute/v1/projects/myproject/global/targetHttpProxies/jclouds-test-2"
-}
\ No newline at end of file
[16/17] jclouds-labs-google git commit: Remove the graduated GCE
provided and updated Maven coordinates
Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
deleted file mode 100644
index 2ef8100..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
+++ /dev/null
@@ -1,318 +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.compute;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Lists.newArrayList;
-import static java.lang.String.format;
-import static org.jclouds.googlecloud.internal.ListPages.concat;
-import static org.jclouds.googlecomputeengine.compute.strategy.CreateNodesWithGroupEncodedIntoNameThenAddToSet.simplifyPorts;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.IMAGE_PROJECTS;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Splitter;
-import com.google.common.base.Strings;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.util.concurrent.Atomics;
-import com.google.common.util.concurrent.UncheckedTimeoutException;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationBuilder;
-import org.jclouds.domain.LocationScope;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.compute.functions.FirewallTagNamingConvention;
-import org.jclouds.googlecomputeengine.compute.functions.Resources;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.domain.AttachDisk;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling;
-import org.jclouds.googlecomputeengine.domain.Instance.Scheduling.OnHostMaintenance;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.domain.NewInstance;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.domain.Tags;
-import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.features.InstanceApi;
-import org.jclouds.location.suppliers.all.JustProvider;
-
-/**
- * This implementation maps the following:
- * <ul>
- * <li>{@linkplain NodeMetadata#getId()} to {@link Instance#selfLink()}</li>
- * <li>{@linkplain NodeMetadata#getGroup()} to {@link Instance#metadata()} as {@code jclouds-group}</li>
- * <li>{@linkplain NodeMetadata#getImageId()} to {@link Instance#metadata()} as {@code jclouds-image}</li>
- * <li>{@linkplain Hardware#getId()} to {@link MachineType#selfLink()}</li>
- * <li>{@linkplain org.jclouds.compute.domain.Image#getId()} to {@link Image#selfLink()}</li>
- * <li>{@linkplain Location#getId()} to {@link org.jclouds.googlecomputeengine.domain.Zone#name()}</li>
- * <li>{@linkplain Location#getDescription()} to {@link Zone#selfLink()}</li>
- * </ul>
- */
-public final class GoogleComputeEngineServiceAdapter
- implements ComputeServiceAdapter<Instance, MachineType, Image, Location> {
-
- private final JustProvider justProvider;
- private final GoogleComputeEngineApi api;
- private final Resources resources;
- private final Predicate<AtomicReference<Operation>> operationDone;
- private final Predicate<AtomicReference<Instance>> instanceVisible;
- private final FirewallTagNamingConvention.Factory firewallTagNamingConvention;
- private final List<String> imageProjects;
- private final LoadingCache<URI, Image> diskURIToImage;
-
- @Inject GoogleComputeEngineServiceAdapter(JustProvider justProvider, GoogleComputeEngineApi api,
- Predicate<AtomicReference<Operation>> operationDone,
- Predicate<AtomicReference<Instance>> instanceVisible,
- Resources resources,
- FirewallTagNamingConvention.Factory firewallTagNamingConvention,
- @Named(IMAGE_PROJECTS) String imageProjects,
- LoadingCache<URI, Image> diskURIToImage) {
- this.justProvider = justProvider;
- this.api = api;
- this.operationDone = operationDone;
- this.instanceVisible = instanceVisible;
- this.resources = resources;
- this.firewallTagNamingConvention = firewallTagNamingConvention;
- this.imageProjects = Splitter.on(',').omitEmptyStrings().splitToList(imageProjects);
- this.diskURIToImage = diskURIToImage;
- }
-
- @Override public NodeAndInitialCredentials<Instance> createNodeWithGroupEncodedIntoName(String group, String name,
- Template template) {
- GoogleComputeEngineTemplateOptions options = GoogleComputeEngineTemplateOptions.class.cast(template.getOptions());
-
- checkNotNull(options.getNetworks(), "template options must specify a network");
- checkNotNull(template.getHardware().getUri(), "hardware must have a URI");
- checkNotNull(template.getImage().getUri(), "image URI is null");
-
- String zone = template.getLocation().getId();
-
- List<AttachDisk> disks = Lists.newArrayList();
- disks.add(AttachDisk.newBootDisk(template.getImage().getUri(), getDiskTypeArgument(options, zone)));
-
- Iterator<String> networks = options.getNetworks().iterator();
-
- URI network = URI.create(networks.next());
- assert !networks.hasNext() : "Error: Options should specify only one network";
-
- // Add tags from template
- ArrayList<String> tags = new ArrayList<String>(options.getTags());
-
- // Add tags for firewalls
- FirewallTagNamingConvention naming = firewallTagNamingConvention.get(group);
- List<String> ports = simplifyPorts(options.getInboundPorts());
- if (ports != null){
- tags.add(naming.name(ports));
- }
-
- NewInstance newInstance = new NewInstance.Builder( name,
- template.getHardware().getUri(), // machineType
- network,
- disks)
- .description(group)
- .tags(Tags.create(null, ImmutableList.copyOf(tags)))
- .serviceAccounts(options.serviceAccounts())
- .build();
-
- // Add metadata from template and for ssh key and image id
- newInstance.metadata().putAll(options.getUserMetadata());
-
- LoginCredentials credentials = resolveNodeCredentials(template);
- if (options.getPublicKey() != null) {
- newInstance.metadata().put("sshKeys",
- format("%s:%s %s@localhost", credentials.getUser(), options.getPublicKey(), credentials.getUser()));
- }
-
- InstanceApi instanceApi = api.instancesInZone(zone);
- Operation create = instanceApi.create(newInstance);
-
- // We need to see the created instance so that we can access the newly created disk.
- AtomicReference<Instance> instance = Atomics.newReference(Instance.create( //
- "0000000000000000000", // id can't be null, but isn't available until provisioning is done.
- null, // creationTimestamp
- create.targetLink(), // selfLink
- newInstance.name(), // name
- newInstance.description(), // description
- newInstance.tags(), // tags
- newInstance.machineType(), // machineType
- Instance.Status.PROVISIONING, // status
- null, // statusMessage
- create.zone(), // zone
- null, // canIpForward
- null, // networkInterfaces
- null, // disks
- newInstance.metadata(), // metadata
- newInstance.serviceAccounts(), // serviceAccounts
- Scheduling.create(OnHostMaintenance.MIGRATE, true) // scheduling
- ));
- checkState(instanceVisible.apply(instance), "instance %s is not api visible!", instance.get());
-
- // Add lookup for InstanceToNodeMetadata
- diskURIToImage.getUnchecked(instance.get().disks().get(0).source());
-
- return new NodeAndInitialCredentials<Instance>(instance.get(), instance.get().selfLink().toString(), credentials);
- }
-
- @Override public Iterable<MachineType> listHardwareProfiles() {
- return filter(concat(api.aggregatedList().machineTypes()), new Predicate<MachineType>() {
- @Override
- public boolean apply(MachineType input) {
- return input.deprecated() == null;
- }
- });
- }
-
- @Override public Iterable<Image> listImages() {
- List<Iterable<Image>> images = newArrayList();
-
- images.add(concat(api.images().list()));
-
- for (String project : imageProjects) {
- images.add(concat(api.images().listInProject(project)));
- }
-
- return Iterables.concat(images);
- }
-
- @Override public Image getImage(String selfLink) {
- return api.images().get(URI.create(checkNotNull(selfLink, "id")));
- }
-
- /** Unlike EC2, you cannot default GCE instances to a region. Hence, we constrain to zones. */
- @Override public Iterable<Location> listLocations() {
- Location provider = justProvider.get().iterator().next();
- ImmutableList.Builder<Location> zones = ImmutableList.builder();
- for (Region region : concat(api.regions().list())) {
- Location regionLocation = new LocationBuilder()
- .scope(LocationScope.REGION)
- .id(region.name())
- .description(region.selfLink().toString())
- .parent(provider).build();
- for (URI zoneSelfLink : region.zones()) {
- String zoneName = toName(zoneSelfLink);
- zones.add(new LocationBuilder()
- .scope(LocationScope.ZONE)
- .id(zoneName)
- .description(zoneSelfLink.toString())
- .parent(regionLocation).build());
- }
- }
- return zones.build();
- }
-
- @Override public Instance getNode(String selfLink) {
- return resources.instance(URI.create(checkNotNull(selfLink, "id")));
- }
-
- @Override public Iterable<Instance> listNodes() {
- return concat(api.aggregatedList().instances());
- }
-
- @Override public Iterable<Instance> listNodesByIds(final Iterable<String> selfLinks) {
- return filter(listNodes(), new Predicate<Instance>() { // TODO: convert to server-side filter
- @Override public boolean apply(Instance instance) {
- return Iterables.contains(selfLinks, instance.selfLink().toString());
- }
- });
- }
-
- @Override public void destroyNode(String selfLink) {
- waitOperationDone(resources.delete(URI.create(checkNotNull(selfLink, "id"))));
- }
-
- @Override public void rebootNode(String selfLink) {
- waitOperationDone(resources.resetInstance(URI.create(checkNotNull(selfLink, "id"))));
- }
-
- @Override public void resumeNode(String selfLink) {
- waitOperationDone(resources.startInstance(URI.create(checkNotNull(selfLink, "id"))));
- }
-
- @Override public void suspendNode(String selfLink) {
- waitOperationDone(resources.stopInstance(URI.create(checkNotNull(selfLink, "id"))));
- }
-
- private void waitOperationDone(Operation operation) {
- AtomicReference<Operation> operationRef = Atomics.newReference(operation);
-
- // wait for the operation to complete
- if (!operationDone.apply(operationRef)) {
- throw new UncheckedTimeoutException("operation did not reach DONE state" + operationRef.get());
- }
-
- // check if the operation failed
- if (operationRef.get().httpErrorStatusCode() != null) {
- throw new IllegalStateException(
- "operation failed. Http Error Code: " + operationRef.get().httpErrorStatusCode() +
- " HttpError: " + operationRef.get().httpErrorMessage());
- }
- }
-
- private LoginCredentials resolveNodeCredentials(Template template) {
- TemplateOptions options = template.getOptions();
- LoginCredentials.Builder credentials = LoginCredentials.builder(template.getImage().getDefaultCredentials());
- if (!Strings.isNullOrEmpty(options.getLoginUser())) {
- credentials.user(options.getLoginUser());
- }
- if (!Strings.isNullOrEmpty(options.getLoginPrivateKey())) {
- credentials.privateKey(options.getLoginPrivateKey());
- }
- if (!Strings.isNullOrEmpty(options.getLoginPassword())) {
- credentials.password(options.getLoginPassword());
- }
- if (options.shouldAuthenticateSudo() != null) {
- credentials.authenticateSudo(options.shouldAuthenticateSudo());
- }
- return credentials.build();
- }
-
- private static String toName(URI link) {
- String path = link.getPath();
- return path.substring(path.lastIndexOf('/') + 1);
- }
-
- private URI getDiskTypeArgument(GoogleComputeEngineTemplateOptions options, String zone) {
- if (options.bootDiskType() != null) {
- DiskType diskType = api.diskTypesInZone(zone).get(options.bootDiskType());
- if (diskType != null) {
- return diskType.selfLink();
- }
- }
-
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java
deleted file mode 100644
index 4951b05..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java
+++ /dev/null
@@ -1,221 +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.compute.config;
-
-import static com.google.common.base.Suppliers.memoizeWithExpiration;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.OPERATION_COMPLETE_INTERVAL;
-import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineProperties.OPERATION_COMPLETE_TIMEOUT;
-import static org.jclouds.rest.config.BinderUtils.bindHttpApi;
-import static org.jclouds.util.Predicates2.retry;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-import java.net.URI;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-
-import com.google.common.base.Function;
-import com.google.common.base.Functions;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMap;
-import com.google.inject.Injector;
-import com.google.inject.Provides;
-import com.google.inject.Scopes;
-import com.google.inject.TypeLiteral;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.ComputeService;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.config.ComputeServiceAdapterContextModule;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.extensions.ImageExtension;
-import org.jclouds.compute.extensions.SecurityGroupExtension;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.googlecomputeengine.compute.GoogleComputeEngineService;
-import org.jclouds.googlecomputeengine.compute.GoogleComputeEngineServiceAdapter;
-import org.jclouds.googlecomputeengine.compute.functions.FirewallTagNamingConvention;
-import org.jclouds.googlecomputeengine.compute.functions.GoogleComputeEngineImageToImage;
-import org.jclouds.googlecomputeengine.compute.functions.ImageNameToOperatingSystem;
-import org.jclouds.googlecomputeengine.compute.functions.InstanceToNodeMetadata;
-import org.jclouds.googlecomputeengine.compute.functions.MachineTypeToHardware;
-import org.jclouds.googlecomputeengine.compute.functions.OrphanedGroupsFromDeadNodes;
-import org.jclouds.googlecomputeengine.compute.functions.Resources;
-import org.jclouds.googlecomputeengine.compute.loaders.DiskURIToImage;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.compute.predicates.AtomicInstanceVisible;
-import org.jclouds.googlecomputeengine.compute.predicates.AtomicOperationDone;
-import org.jclouds.googlecomputeengine.compute.predicates.GroupIsEmpty;
-import org.jclouds.googlecomputeengine.compute.strategy.CreateNodesWithGroupEncodedIntoNameThenAddToSet;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.location.suppliers.ImplicitLocationSupplier;
-import org.jclouds.location.suppliers.implicit.FirstZone;
-
-public final class GoogleComputeEngineServiceContextModule
- extends ComputeServiceAdapterContextModule<Instance, MachineType, Image, Location> {
-
- @Override
- protected void configure() {
- super.configure();
-
- bind(ComputeService.class).to(GoogleComputeEngineService.class);
-
- bind(new TypeLiteral<ComputeServiceAdapter<Instance, MachineType, Image, Location>>() {
- }).to(GoogleComputeEngineServiceAdapter.class);
-
- // Use compute service to supply locations, which are always zones.
- install(new LocationsFromComputeServiceAdapterModule<Instance, MachineType, Image, Location>() {
- });
- bind(new TypeLiteral<Function<Location, Location>>() {
- }).toInstance(Functions.<Location>identity());
- bind(ImplicitLocationSupplier.class).to(FirstZone.class);
-
- bind(new TypeLiteral<Function<Instance, NodeMetadata>>() {
- }).to(InstanceToNodeMetadata.class);
-
- bind(new TypeLiteral<Function<MachineType, Hardware>>() {
- }).to(MachineTypeToHardware.class);
-
- bind(new TypeLiteral<Function<Image, org.jclouds.compute.domain.Image>>() {
- }).to(GoogleComputeEngineImageToImage.class);
-
- bind(org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.class)
- .to(CreateNodesWithGroupEncodedIntoNameThenAddToSet.class);
-
- bind(TemplateOptions.class).to(GoogleComputeEngineTemplateOptions.class);
-
- bind(new TypeLiteral<Function<Set<? extends NodeMetadata>, Set<String>>>() {
- }).to(OrphanedGroupsFromDeadNodes.class);
-
- bind(new TypeLiteral<Predicate<String>>() {
- }).to(GroupIsEmpty.class);
-
- bind(new TypeLiteral<Function<String, OperatingSystem>>() {
- }).to(ImageNameToOperatingSystem.class);
-
- bind(FirewallTagNamingConvention.Factory.class).in(Scopes.SINGLETON);
-
- bind(new TypeLiteral<CacheLoader<URI, Image>>() {
- }).to(DiskURIToImage.class);
-
- bindHttpApi(binder(), Resources.class);
- }
-
- // TODO: these timeouts need thinking through.
- @Provides Predicate<AtomicReference<Operation>> operationDone(AtomicOperationDone input,
- @Named(OPERATION_COMPLETE_TIMEOUT) long timeout, @Named(OPERATION_COMPLETE_INTERVAL) long interval) {
- return retry(input, timeout, interval, MILLISECONDS);
- }
-
- @Provides Predicate<AtomicReference<Instance>> instanceVisible(AtomicInstanceVisible input,
- @Named(OPERATION_COMPLETE_TIMEOUT) long timeout, @Named(OPERATION_COMPLETE_INTERVAL) long interval) {
- return retry(input, timeout, interval, MILLISECONDS);
- }
-
- @Provides @Singleton @Memoized Supplier<Map<URI, Hardware>> hardwareByUri(
- @Memoized final Supplier<Set<? extends Hardware>> hardwareSupplier,
- @Named(PROPERTY_SESSION_INTERVAL) long seconds) {
- return memoizeWithExpiration(new Supplier<Map<URI, Hardware>>() {
- @Override public Map<URI, Hardware> get() {
- ImmutableMap.Builder<URI, Hardware> result = ImmutableMap.builder();
- for (Hardware hardware : hardwareSupplier.get()) {
- result.put(hardware.getUri(), hardware);
- }
- return result.build();
- }
- }, seconds, SECONDS);
- }
-
- @Provides @Singleton @Memoized Supplier<Map<URI, Location>> locationsByUri(
- @Memoized final Supplier<Set<? extends Location>> locations, @Named(PROPERTY_SESSION_INTERVAL) long seconds) {
- return memoizeWithExpiration(new Supplier<Map<URI, Location>>() {
- @Override
- public Map<URI, Location> get() {
- ImmutableMap.Builder<URI, Location> result = ImmutableMap.builder();
- for (Location location : locations.get()) {
- result.put(URI.create(location.getDescription()), location);
- }
- return result.build();
- }
- }, seconds, SECONDS);
- }
-
- @Override
- protected Map<OsFamily, LoginCredentials> osFamilyToCredentials(Injector injector) {
- // GCE does not enable the 'root' account for ssh access by default, but it will create a privileged
- // user when the SSH key is provided. Populate the map to use 'jclouds' as a default user.
- ImmutableMap.Builder<OsFamily, LoginCredentials> builder = ImmutableMap.builder();
- for (OsFamily family : OsFamily.values()) {
- switch (family) {
- case COREOS:
- builder.put(family, LoginCredentials.builder().user("core").build());
- break;
- case WINDOWS:
- builder.put(family, LoginCredentials.builder().user("Administrator").build());
- break;
- default:
- builder.put(family, LoginCredentials.builder().user("jclouds").build());
- break;
- }
- }
- return builder.build();
- }
-
- @Provides
- @Singleton
- protected LoadingCache<URI, Image> diskURIToImageMap(
- CacheLoader<URI, Image> in) {
- return CacheBuilder.newBuilder().build(in);
- }
-
-
- @Override protected Optional<ImageExtension> provideImageExtension(Injector i) {
- return Optional.absent();
- }
-
- @Override protected Optional<SecurityGroupExtension> provideSecurityGroupExtension(Injector i) {
- return Optional.absent();
- }
-
- private static final Map<Instance.Status, NodeMetadata.Status> toPortableNodeStatus =
- ImmutableMap.<Instance.Status, NodeMetadata.Status>builder()
- .put(Instance.Status.PROVISIONING, NodeMetadata.Status.PENDING)
- .put(Instance.Status.STAGING, NodeMetadata.Status.PENDING)
- .put(Instance.Status.RUNNING, NodeMetadata.Status.RUNNING)
- .put(Instance.Status.STOPPING, NodeMetadata.Status.PENDING)
- .put(Instance.Status.STOPPED, NodeMetadata.Status.SUSPENDED)
- .put(Instance.Status.TERMINATED, NodeMetadata.Status.SUSPENDED).build();
-
- @Provides Map<Instance.Status, NodeMetadata.Status> toPortableNodeStatus() {
- return toPortableNodeStatus;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/FirewallTagNamingConvention.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/FirewallTagNamingConvention.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/FirewallTagNamingConvention.java
deleted file mode 100644
index 61e4fd0..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/FirewallTagNamingConvention.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.compute.functions;
-
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.jclouds.compute.functions.GroupNamingConvention;
-
-/**
- * The convention for naming instance tags that firewall rules recognise.
- */
-public final class FirewallTagNamingConvention {
-
- public static final class Factory {
-
- private final GroupNamingConvention.Factory namingConvention;
-
- @Inject Factory(GroupNamingConvention.Factory namingConvention) {
- this.namingConvention = namingConvention;
- }
-
- public FirewallTagNamingConvention get(String groupName) {
- return new FirewallTagNamingConvention(namingConvention.create().sharedNameForGroup(groupName));
- }
- }
-
- private final String sharedResourceName;
-
- public FirewallTagNamingConvention(String sharedResourceName) {
- this.sharedResourceName = sharedResourceName;
- }
-
- public String name(List<String> ports) {
- final int prime = 31;
- int result = 1;
- for (String s : ports){
- result = result * prime + s.hashCode();
- // TODO(broudy): this may break between java versions! Consider a different implementation.
- }
-
- return String.format("%s-%s", sharedResourceName, Integer.toHexString(result));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImage.java
deleted file mode 100644
index 37079ba..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.compute.functions;
-
-import javax.inject.Inject;
-
-import org.jclouds.compute.domain.Image.Status;
-import org.jclouds.compute.domain.ImageBuilder;
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.googlecomputeengine.domain.Deprecated.State;
-import org.jclouds.googlecomputeengine.domain.Image;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-
-public final class GoogleComputeEngineImageToImage implements Function<Image, org.jclouds.compute.domain.Image> {
- private final Function<String, OperatingSystem> nameToOperatingSystem;
-
- @Inject GoogleComputeEngineImageToImage(Function<String, OperatingSystem> nameToOperatingSystem) {
- this.nameToOperatingSystem = nameToOperatingSystem;
- }
-
- @Override public org.jclouds.compute.domain.Image apply(Image image) {
- ImageBuilder builder = new ImageBuilder()
- .id(image.selfLink().toString())
- .providerId(image.id())
- .name(image.name())
- .providerId(image.id())
- .description(image.description())
- .status(Status.AVAILABLE)
- .uri(image.selfLink());
-
- if (image.deprecated() != null) {
- builder.userMetadata(ImmutableMap.of("deprecatedState", image.deprecated().state().name()));
- if (image.deprecated().state() == State.DELETED){
- builder.status(Status.DELETED);
- }
- }
-
- builder.version(image.name().substring(image.name().lastIndexOf('-') + 1));
- builder.operatingSystem(nameToOperatingSystem.apply(image.name()));
-
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystem.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystem.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystem.java
deleted file mode 100644
index 7ecd89f..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ImageNameToOperatingSystem.java
+++ /dev/null
@@ -1,65 +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.compute.functions;
-
-import static com.google.common.base.Joiner.on;
-import static com.google.common.collect.Iterables.limit;
-import static com.google.common.collect.Iterables.skip;
-
-import java.util.List;
-
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.compute.domain.OsFamily;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-
-public class ImageNameToOperatingSystem implements Function<String, OperatingSystem> {
-
- @Override public OperatingSystem apply(String input) {
- // Remove the backport prefix before parsing the name
- String name = input.contains("backports") ? input.substring(input.indexOf("backports-") + 10) : input;
-
- OperatingSystem.Builder builder = defaultOperatingSystem(name);
- List<String> splits = Lists.newArrayList(name.split("-"));
- if (splits == null || splits.size() == 0 || splits.size() < 3) {
- return builder.build();
- }
-
- // GCE namings that don't match the OsFamily enum
- String os = splits.get(0);
- if ("opensuse".equals(os) || "sles".equals(os)) {
- builder.family(OsFamily.SUSE);
- } else {
- OsFamily family = OsFamily.fromValue(os);
- if (family != OsFamily.UNRECOGNIZED) {
- builder.family(family);
- }
- }
-
- // TODO: Improve the version parsing so it is more portable
- String version = on(".").join(limit(skip(splits, 1), splits.size() - 2));
- builder.version(version);
-
- return builder.build();
- }
-
- private OperatingSystem.Builder defaultOperatingSystem(String name) {
- return OperatingSystem.builder().family(OsFamily.LINUX).is64Bit(true).description(name);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java
deleted file mode 100644
index 6f72bee..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java
+++ /dev/null
@@ -1,114 +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.compute.functions;
-
-import static org.jclouds.compute.util.ComputeServiceUtils.groupFromMapOrName;
-
-import javax.inject.Inject;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableList;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeMetadata.Status;
-import org.jclouds.compute.domain.NodeMetadataBuilder;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.domain.Location;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-
-public final class InstanceToNodeMetadata implements Function<Instance, NodeMetadata> {
-
- private final Map<Instance.Status, NodeMetadata.Status> toPortableNodeStatus;
- private final GroupNamingConvention nodeNamingConvention;
- private final LoadingCache<URI, Image> diskURIToImage;
- private final Supplier<Map<URI, Hardware>> hardwares;
- private final Supplier<Map<URI, Location>> locationsByUri;
-
- @Inject InstanceToNodeMetadata(Map<Instance.Status, NodeMetadata.Status> toPortableNodeStatus,
- GroupNamingConvention.Factory namingConvention,
- LoadingCache<URI, Image> diskURIToImage,
- @Memoized Supplier<Map<URI, Hardware>> hardwares,
- @Memoized Supplier<Map<URI, Location>> locationsByUri) {
- this.toPortableNodeStatus = toPortableNodeStatus;
- this.nodeNamingConvention = namingConvention.createWithoutPrefix();
- this.diskURIToImage = diskURIToImage;
- this.hardwares = hardwares;
- this.locationsByUri = locationsByUri;
- }
-
- @Override public NodeMetadata apply(Instance input) {
- String group = groupFromMapOrName(input.metadata().asMap(), input.name(), nodeNamingConvention);
- NodeMetadataBuilder builder = new NodeMetadataBuilder();
-
- Location zone = locationsByUri.get().get(input.zone());
- if (zone == null) {
- throw new IllegalStateException(
- String.format("zone %s not present in %s", input.zone(), locationsByUri.get().keySet()));
- }
-
- // The boot disk is the first disk. It may have been created from an image, so look it up.
- //
- // Note: This will be present if we created the node. In the future we could choose to make diskToSourceImage
- // a loading cache. That would be more expensive, but could ensure this isn't null.
- Image image = diskURIToImage.getUnchecked(input.disks().get(0).source());
-
- builder.id(input.selfLink().toString())
- .name(input.name())
- .providerId(input.id())
- .hostname(input.name())
- .location(zone)
- .imageId(image != null ? image.selfLink().toString() : null)
- .hardware(hardwares.get().get(input.machineType()))
- .status(input.status() != null ? toPortableNodeStatus.get(input.status()) : Status.UNRECOGNIZED)
- .tags(input.tags().items())
- .uri(input.selfLink())
- .userMetadata(input.metadata().asMap())
- .group(group)
- .privateAddresses(collectPrivateAddresses(input))
- .publicAddresses(collectPublicAddresses(input));
- return builder.build();
- }
-
- private List<String> collectPrivateAddresses(Instance input) {
- ImmutableList.Builder<String> privateAddressesBuilder = ImmutableList.builder();
- for (Instance.NetworkInterface networkInterface : input.networkInterfaces()) {
- if (networkInterface.networkIP() != null) {
- privateAddressesBuilder.add(networkInterface.networkIP());
- }
- }
- return privateAddressesBuilder.build();
- }
-
- private List<String> collectPublicAddresses(Instance input) {
- ImmutableList.Builder<String> publicAddressesBuilder = ImmutableList.builder();
- for (Instance.NetworkInterface networkInterface : input.networkInterfaces()) {
- for (Instance.NetworkInterface.AccessConfig accessConfig : networkInterface.accessConfigs()) {
- if (accessConfig.natIP() != null) {
- publicAddressesBuilder.add(accessConfig.natIP());
- }
- }
- }
- return publicAddressesBuilder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/MachineTypeToHardware.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/MachineTypeToHardware.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/MachineTypeToHardware.java
deleted file mode 100644
index a1eaf36..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/MachineTypeToHardware.java
+++ /dev/null
@@ -1,83 +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.compute.functions;
-
-import java.net.URI;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.domain.VolumeBuilder;
-import org.jclouds.domain.Location;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicates;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableSet;
-
-public final class MachineTypeToHardware implements Function<MachineType, Hardware> {
-
- private final Supplier<Map<URI, Location>> locationsByUri;
-
- @Inject MachineTypeToHardware(@Memoized Supplier<Map<URI, Location>> locationsByUri) {
- this.locationsByUri = locationsByUri;
- }
-
- @Override
- public Hardware apply(MachineType input) {
- URI zoneLink = URI.create(
- input.selfLink().toString().replace("/machineTypes/" + input.name(), ""));
-
- Location zone = locationsByUri.get().get(zoneLink);
- if (zone == null) {
- throw new IllegalStateException(
- String.format("zone %s not present in %s", zoneLink, locationsByUri.get().keySet()));
- }
- return new HardwareBuilder()
- .id(input.selfLink().toString())
- .providerId(input.id())
- .location(zone)
- .name(input.name())
- .hypervisor("kvm")
- .processor(new Processor(input.guestCpus(), 1.0))
- .providerId(input.id())
- .ram(input.memoryMb())
- .uri(input.selfLink())
- .volumes(collectVolumes(input))
- .supportsImage(Predicates.<Image>alwaysTrue())
- .build();
- }
-
- private Iterable<Volume> collectVolumes(MachineType input) {
- ImmutableSet.Builder<Volume> volumes = ImmutableSet.builder();
- for (MachineType.ScratchDisk disk : input.scratchDisks()) {
- volumes.add(new VolumeBuilder()
- .type(Volume.Type.LOCAL)
- .size(Float.valueOf(disk.diskGb()))
- .bootDevice(true)
- .durable(false).build());
- }
- return volumes.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodes.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodes.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodes.java
deleted file mode 100644
index 09c4a17..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/OrphanedGroupsFromDeadNodes.java
+++ /dev/null
@@ -1,51 +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.compute.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-
-import org.jclouds.compute.domain.NodeMetadata;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Sets;
-
-public final class OrphanedGroupsFromDeadNodes implements Function<Set<? extends NodeMetadata>, Set<String>> {
-
- private final Predicate<String> isOrphanedGroupPredicate;
-
- @Inject OrphanedGroupsFromDeadNodes(Predicate<String> isOrphanedGroupPredicate) {
- this.isOrphanedGroupPredicate = isOrphanedGroupPredicate;
- }
-
-
- @Override public Set<String> apply(Set<? extends NodeMetadata> deadNodes) {
- Set<String> groups = Sets.newLinkedHashSet();
- for (NodeMetadata deadNode : deadNodes) {
- groups.add(deadNode.getGroup());
- }
- Set<String> orphanedGroups = Sets.newLinkedHashSet();
- for (String group : groups) {
- if (isOrphanedGroupPredicate.apply(group)) {
- orphanedGroups.add(group);
- }
- }
- return orphanedGroups;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/Resources.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/Resources.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/Resources.java
deleted file mode 100644
index 97c4a3e..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/Resources.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.compute.functions;
-
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.Fallbacks.NullOnNotFoundOr404;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import java.net.URI;
-
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.oauth.v2.filters.OAuthFilter;
-import org.jclouds.rest.annotations.EndpointParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SkipEncoding;
-
-@SkipEncoding({'/', '='})
-@RequestFilters(OAuthFilter.class)
-@Consumes(APPLICATION_JSON)
-public interface Resources {
-
- /** Returns an instance by self-link or null if not found. */
- @Named("Instances:get")
- @GET
- @Fallback(NullOnNotFoundOr404.class) @Nullable Instance instance(@EndpointParam URI selfLink);
-
- /** Returns an network by self-link or null if not found. */
- @Named("Networks:get")
- @GET
- @Fallback(NullOnNotFoundOr404.class) @Nullable Network network(@EndpointParam URI selfLink);
-
- /** Returns an operation by self-link or null if not found. */
- @Named("Operations:get")
- @GET
- @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. */
- @Named("Resources:delete")
- @DELETE
- @Fallback(NullOnNotFoundOr404.class) @Nullable Operation delete(@EndpointParam URI selfLink);
-
- /** Hard-resets the instance by self-link and returns the operation in progress */
- @Named("Instances:reset")
- @POST
- @Path("/reset")
- Operation resetInstance(@EndpointParam URI selfLink);
-
- /** Starts the instance by self-link and returns the operation in progress */
- @Named("Instances:start")
- @POST
- @Path("/start")
- Operation startInstance(@EndpointParam URI selfLink);
-
- /** Stops the instance by self-link and returns the operation in progress */
- @Named("Instances:stop")
- @POST
- @Path("/stop")
- Operation stopInstance(@EndpointParam URI selfLink);
-
- /** Returns a disk by self-link or null if not found. */
- @Named("Disks:get")
- @GET
- @Fallback(NullOnNotFoundOr404.class) @Nullable Disk disk(@EndpointParam URI selfLink);
-
- /** Returns an image by self-link or null if not found. */
- @Named("Images:get")
- @GET
- @Fallback(NullOnNotFoundOr404.class) @Nullable Image image(@EndpointParam URI selfLink);
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java
deleted file mode 100644
index 0dccaf4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java
+++ /dev/null
@@ -1,57 +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.compute.loaders;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import java.net.URI;
-import java.util.concurrent.ExecutionException;
-
-import com.google.common.cache.CacheLoader;
-import org.jclouds.googlecomputeengine.compute.functions.Resources;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.logging.Logger;
-
-
-@Singleton
-public class DiskURIToImage extends CacheLoader<URI, Image> {
- @Resource
- protected Logger logger = Logger.NULL;
-
- private final Resources resources;
-
- @Inject
- DiskURIToImage(Resources resources) {
- this.resources = resources;
- }
-
- @Override
- public Image load(URI key) throws ExecutionException {
- try {
- Disk disk = resources.disk(key);
- return resources.image(disk.sourceImage());
- } catch (Exception e) {
- throw new ExecutionException(message(key, e), e);
- }
- }
-
- public static String message(URI key, Exception e) {
- return String.format("could not find image for disk %s: %s", key.toString(), e.getMessage());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java
deleted file mode 100644
index a2cbd1f..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java
+++ /dev/null
@@ -1,283 +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.compute.options;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.googlecomputeengine.domain.Instance.ServiceAccount;
-import org.jclouds.scriptbuilder.domain.Statement;
-
-/** Instance options specific to Google Compute Engine. */
-public final class GoogleComputeEngineTemplateOptions extends TemplateOptions {
-
- private boolean autoCreateKeyPair = true;
- private List<ServiceAccount> serviceAccounts;
- private String bootDiskType;
-
- @Override
- public GoogleComputeEngineTemplateOptions clone() {
- GoogleComputeEngineTemplateOptions options = new GoogleComputeEngineTemplateOptions();
- copyTo(options);
- return options;
- }
-
- @Override
- public void copyTo(TemplateOptions to) {
- super.copyTo(to);
- if (to instanceof GoogleComputeEngineTemplateOptions) {
- GoogleComputeEngineTemplateOptions eTo = GoogleComputeEngineTemplateOptions.class.cast(to);
- eTo.autoCreateKeyPair(autoCreateKeyPair());
- eTo.serviceAccounts(serviceAccounts());
- eTo.bootDiskType(bootDiskType());
- }
- }
-
- /**
- * Sets the boot disk type.
- */
- public GoogleComputeEngineTemplateOptions bootDiskType(String diskType) {
- this.bootDiskType = diskType;
- return this;
- }
-
- /**
- * Gets the boot disk type.
- */
- public String bootDiskType() {
- return bootDiskType;
- }
-
- /**
- * Sets whether an SSH key pair should be created automatically.
- */
- public GoogleComputeEngineTemplateOptions autoCreateKeyPair(boolean autoCreateKeyPair) {
- this.autoCreateKeyPair = autoCreateKeyPair;
- return this;
- }
-
- /**
- * Gets whether an SSH key pair should be created automatically.
- */
- public boolean autoCreateKeyPair() {
- return autoCreateKeyPair;
- }
-
- /**
- * Sets a list of service accounts, with their specified scopes, to authorize on created instance.
- * For example, to give a node the 'compute' scope you would add a service account with the email 'default'
- * and the scope 'https://www.googleapis.com/auth/compute'
- * These scopes will be given to all nodes created with these template options.
- */
- public GoogleComputeEngineTemplateOptions serviceAccounts(List<ServiceAccount> serviceAccounts){
- this.serviceAccounts = serviceAccounts;
- return this;
- }
-
- /**
- * Gets the list of service accounts, with their specified scopes, that will be authorize on created instances.
- */
- public List<ServiceAccount> serviceAccounts(){
- return serviceAccounts;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions blockOnPort(int port, int seconds) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.blockOnPort(port, seconds));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions inboundPorts(int... ports) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.inboundPorts(ports));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions authorizePublicKey(String publicKey) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.authorizePublicKey(publicKey));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions installPrivateKey(String privateKey) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.installPrivateKey(privateKey));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions blockUntilRunning(boolean blockUntilRunning) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.blockUntilRunning(blockUntilRunning));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions dontAuthorizePublicKey() {
- return GoogleComputeEngineTemplateOptions.class.cast(super.dontAuthorizePublicKey());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions nameTask(String name) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.nameTask(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions runAsRoot(boolean runAsRoot) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.runAsRoot(runAsRoot));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions runScript(Statement script) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.runScript(script));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.overrideLoginCredentials(overridingCredentials));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions overrideLoginPassword(String password) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.overrideLoginPassword(password));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions overrideLoginPrivateKey(String privateKey) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.overrideLoginPrivateKey(privateKey));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions overrideLoginUser(String loginUser) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.overrideLoginUser(loginUser));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.overrideAuthenticateSudo(authenticateSudo));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions userMetadata(Map<String, String> userMetadata) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.userMetadata(userMetadata));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions userMetadata(String key, String value) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.userMetadata(key, value));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions nodeNames(Iterable<String> nodeNames) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.nodeNames(nodeNames));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions networks(Iterable<String> networks) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.networks(networks));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions networks(String... networks) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.networks(networks));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions tags(Iterable<String> tags) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.tags(tags));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions wrapInInitScript(boolean wrapInInitScript) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.wrapInInitScript(wrapInInitScript));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions runScript(String script) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.runScript(script));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GoogleComputeEngineTemplateOptions blockOnComplete(boolean blockOnComplete) {
- return GoogleComputeEngineTemplateOptions.class.cast(super.blockOnComplete(blockOnComplete));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicInstanceVisible.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicInstanceVisible.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicInstanceVisible.java
deleted file mode 100644
index ab7a512..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicInstanceVisible.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.compute.predicates;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.compute.functions.Resources;
-import org.jclouds.googlecomputeengine.domain.Instance;
-
-import com.google.common.base.Predicate;
-
-public final class AtomicInstanceVisible implements Predicate<AtomicReference<Instance>> {
-
- private final Resources resources;
-
- @Inject AtomicInstanceVisible(Resources resources) {
- this.resources = resources;
- }
-
- @Override public boolean apply(AtomicReference<Instance> input) {
- Instance response = resources.instance(input.get().selfLink());
- if (response == null) {
- return false;
- }
- input.set(response);
- return true;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicOperationDone.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicOperationDone.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicOperationDone.java
deleted file mode 100644
index 2bf1c80..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicOperationDone.java
+++ /dev/null
@@ -1,53 +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.compute.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.compute.functions.Resources;
-import org.jclouds.googlecomputeengine.domain.Operation;
-
-import com.google.common.base.Predicate;
-
-public final class AtomicOperationDone implements Predicate<AtomicReference<Operation>> {
-
- private final Resources resources;
-
- @Inject AtomicOperationDone(Resources resources) {
- this.resources = resources;
- }
-
- @Override public boolean apply(AtomicReference<Operation> input) {
- checkNotNull(input.get(), "operation");
- Operation current = resources.operation(input.get().selfLink());
- input.set(current);
- checkState(current.error().errors().isEmpty(), "Task ended in error %s", current); // ISE will break the loop.
- switch (current.status()) {
- case DONE:
- return true;
- case PENDING:
- case RUNNING:
- default:
- return false;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/GroupIsEmpty.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/GroupIsEmpty.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/GroupIsEmpty.java
deleted file mode 100644
index 3b5c093..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/GroupIsEmpty.java
+++ /dev/null
@@ -1,42 +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.compute.predicates;
-
-import static com.google.common.collect.Iterables.isEmpty;
-import static com.google.common.collect.Sets.filter;
-import static org.jclouds.compute.predicates.NodePredicates.all;
-import static org.jclouds.compute.predicates.NodePredicates.inGroup;
-
-import javax.inject.Inject;
-
-import org.jclouds.compute.ComputeService;
-
-import com.google.common.base.Predicate;
-
-public final class GroupIsEmpty implements Predicate<String> {
-
- private final ComputeService computeService;
-
- @Inject GroupIsEmpty(ComputeService computeService) {
- this.computeService = computeService;
- }
-
-
- @Override public boolean apply(String groupName) {
- return isEmpty(filter(computeService.listNodesDetailsMatching(all()), inGroup(groupName)));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/cf9af834/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java
deleted file mode 100644
index 20bc2c3..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java
+++ /dev/null
@@ -1,233 +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.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.ImmutableList.of;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.jclouds.Constants;
-import org.jclouds.compute.config.CustomizationResponse;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.compute.strategy.CreateNodeWithGroupEncodedIntoName;
-import org.jclouds.compute.strategy.CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap;
-import org.jclouds.compute.strategy.ListNodesStrategy;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.compute.functions.FirewallTagNamingConvention;
-import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.Firewall.Rule;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.features.FirewallApi;
-import org.jclouds.googlecomputeengine.options.FirewallOptions;
-import org.jclouds.logging.Logger;
-import org.jclouds.ssh.SshKeyPairGenerator;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.Atomics;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-
-public final class CreateNodesWithGroupEncodedIntoNameThenAddToSet extends
- org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet {
-
- public static final String EXTERIOR_RANGE = "0.0.0.0/0";
- public static final String DEFAULT_INTERNAL_NETWORK_RANGE = "10.0.0.0/8";
-
- public static final String DEFAULT_NETWORK_NAME = "default";
-
- private final GoogleComputeEngineApi api;
- private final Predicate<AtomicReference<Operation>> operationDone;
- private final FirewallTagNamingConvention.Factory firewallTagNamingConvention;
- private final SshKeyPairGenerator keyGenerator;
-
- @Resource
- @Named(ComputeServiceConstants.COMPUTE_LOGGER)
- protected Logger logger = Logger.NULL;
-
- @Inject
- CreateNodesWithGroupEncodedIntoNameThenAddToSet(
- CreateNodeWithGroupEncodedIntoName addNodeWithGroupStrategy,
- ListNodesStrategy listNodesStrategy,
- GroupNamingConvention.Factory namingConvention,
- @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor,
- CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.Factory customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory,
- GoogleComputeEngineApi api, Predicate<AtomicReference<Operation>> operationDone,
- FirewallTagNamingConvention.Factory firewallTagNamingConvention, SshKeyPairGenerator keyGenerator) {
- super(addNodeWithGroupStrategy, listNodesStrategy, namingConvention, userExecutor,
- customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory);
- this.api = api;
- this.operationDone = operationDone;
- this.firewallTagNamingConvention = firewallTagNamingConvention;
- this.keyGenerator = keyGenerator;
- }
-
- @Override
- public Map<?, ListenableFuture<Void>> execute(String group, int count, Template template,
- Set<NodeMetadata> goodNodes, Map<NodeMetadata, Exception> badNodes,
- Multimap<NodeMetadata, CustomizationResponse> customizationResponses) {
-
- Template mutableTemplate = template.clone();
- GoogleComputeEngineTemplateOptions templateOptions = GoogleComputeEngineTemplateOptions.class
- .cast(mutableTemplate.getOptions());
- assert template.getOptions().equals(templateOptions) : "options didn't clone properly";
-
- // Get Network
- Network network = getNetwork(templateOptions.getNetworks());
- // Setup Firewall rules
- getOrCreateFirewalls(templateOptions, network, firewallTagNamingConvention.get(group));
- templateOptions.networks(ImmutableSet.of(network.selfLink().toString()));
- templateOptions.userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, group);
-
- // Configure the default credentials, if needed
- if (templateOptions.autoCreateKeyPair() && Strings.isNullOrEmpty(templateOptions.getPublicKey())) {
- logger.debug(">> creating default keypair...");
- Map<String, String> defaultKeys = keyGenerator.get();
- templateOptions.authorizePublicKey(defaultKeys.get("public"));
- templateOptions.overrideLoginPrivateKey(defaultKeys.get("private"));
- }
-
- if (templateOptions.getRunScript() != null && templateOptions.getLoginPrivateKey() == null) {
- logger.warn(">> A runScript has been configured but no SSH key has been provided."
- + " Authentication will delegate to the ssh-agent");
- }
-
- return super.execute(group, count, mutableTemplate, goodNodes, badNodes, customizationResponses);
- }
-
- /**
- * Try and find a network previously created by the user.
- */
- private Network getNetwork(Set<String> networks) {
- String networkName;
- if (networks == null || networks.isEmpty()){
- networkName = DEFAULT_NETWORK_NAME;
- }
- else {
- Iterator<String> iterator = networks.iterator();
- networkName = nameFromNetworkString(iterator.next());
- checkArgument(!iterator.hasNext(), "Error: Please specify only one network in TemplateOptions when using GCE.");
-
- }
- Network network = api.networks().get(networkName);
- checkArgument(network != null, "Error: no network with name %s was found", networkName);
- return network;
- }
-
- /**
- * Ensures that a firewall exists for every inbound port that the instance
- * requests.
- * <p>
- * For each port, there must be a firewall with a name following the
- * {@link FirewallTagNamingConvention}, with a target tag also following the
- * {@link FirewallTagNamingConvention}, which opens the requested port for
- * all sources on both TCP and UDP protocols.
- *
- * @see org.jclouds.googlecomputeengine.features.FirewallApi#patch(String,
- * org.jclouds.googlecomputeengine.options.FirewallOptions)
- */
- private void getOrCreateFirewalls(GoogleComputeEngineTemplateOptions templateOptions, Network network,
- FirewallTagNamingConvention naming) {
-
- FirewallApi firewallApi = api.firewalls();
- int[] inboundPorts = templateOptions.getInboundPorts();
- if ((inboundPorts == null) || inboundPorts.length == 0){
- return;
- }
-
- List<String> ports = simplifyPorts(inboundPorts);
- String name = naming.name(ports);
- Firewall firewall = firewallApi.get(name);
- AtomicReference<Operation> operation = null;
- if (firewall == null) {
- List<Rule> rules = ImmutableList.of(Rule.create("tcp", ports), Rule.create("udp", ports));
- FirewallOptions firewallOptions = new FirewallOptions().name(name).network(network.selfLink())
- .allowedRules(rules).sourceTags(templateOptions.getTags())
- .sourceRanges(of(DEFAULT_INTERNAL_NETWORK_RANGE, EXTERIOR_RANGE))
- .targetTags(ImmutableList.of(name));
-
- operation = Atomics.newReference(firewallApi
- .createInNetwork(firewallOptions.name(), network.selfLink(), firewallOptions));
-
- operationDone.apply(operation);
- checkState(operation.get().httpErrorStatusCode() == null, "Could not insert firewall, operation failed %s",
- operation);
- }
- }
-
- // Helper function for simplifying an array of ports to a list of ranges FirewallOptions expects.
- public static List<String> simplifyPorts(int[] ports){
- if ((ports == null) || (ports.length == 0)) {
- return null;
- }
- ArrayList<String> output = new ArrayList<String>();
- Arrays.sort(ports);
-
- int range_start = ports[0];
- int range_end = ports[0];
- for (int i = 1; i < ports.length; i++) {
- if ((ports[i - 1] == ports[i] - 1) || (ports[i - 1] == ports[i])){
- // Range continues.
- range_end = ports[i];
- }
- else {
- // Range ends.
- output.add(formatRange(range_start, range_end));
- range_start = ports[i];
- range_end = ports[i];
- }
- }
- // Make sure we get the last range.
- output.add(formatRange(range_start, range_end));
- return output;
- }
-
- // Helper function for simplifyPorts. Formats port range strings.
- private static String formatRange(int start, int finish){
- if (start == finish){
- return Integer.toString(start);
- }
- else {
- return String.format("%s-%s", Integer.toString(start), Integer.toString(finish));
- }
- }
-
- // Helper function for getting the network name from the full URI.
- public static String nameFromNetworkString(String networkString) {
- return networkString.substring(networkString.lastIndexOf('/') + 1);
- }
-}