You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Adrian Cole <no...@github.com> on 2014/11/08 05:17:49 UTC

[jclouds-labs-google] Add aggregation apis, which remove complexity around lists and circular dep on location (#86)

Also start using MWS tests.
You can merge this Pull Request by running:

  git pull https://github.com/adriancole/jclouds-labs-google adrian.location-location

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds-labs-google/pull/86

-- Commit Summary --

  * Add aggregation apis, which remove complexity around lists and circular dep on location. Start using MWS tests.

-- File Changes --

    M google-compute-engine/pom.xml (12)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java (10)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java (178)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java (39)
    D google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/domain/InstanceInZone.java (39)
    D google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/domain/MachineTypeInZone.java (35)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImage.java (3)
    R google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java (37)
    R google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/MachineTypeToHardware.java (25)
    R google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/Resources.java (25)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicInstanceVisible.java (6)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/predicates/AtomicOperationDone.java (6)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineHttpApiModule.java (8)
    D google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineLocationModule.java (194)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java (81)
    A google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AggregatedListApi.java (177)
    M google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToIteratorOfListPage.java (12)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/binders/ForwardingRuleCreationBinderTest.java (3)
    D google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceExpectTest.java (551)
    A google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceMockTest.java (317)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/CreateNetworkIfNeededTest.java (18)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/FindNetworkOrCreateTest.java (10)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/FirewallToIpPermissionTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/GoogleComputeEngineImageToImageTest.java (4)
    R google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadataTest.java (60)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java (28)
    A google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiLiveTest.java (46)
    A google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AggregatedListApiMockTest.java (67)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java (48)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskTypeApiExpectTest.java (14)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java (42)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiExpectTest.java (36)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/HttpHealthCheckApiExpectTest.java (48)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java (26)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java (90)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java (16)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiLiveTest.java (1)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java (28)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/OperationApiExpectTest.java (34)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java (12)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java (10)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java (32)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java (10)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiExpectTest.java (64)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java (10)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/internal/ToIteratorOfListPageExpectTest.java (28)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiExpectTest.java (2)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java (18)
    A google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiMockTest.java (143)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineExpectTest.java (43)
    A google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/GoogleComputeEngineTestModule.java (95)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseForwardingRuleTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseGlobalOperationTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java (10)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeTest.java (2)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java (2)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java (10)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseProjectTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionOperationTest.java (8)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java (6)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseTargetPoolTest.java (4)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneListTest.java (2)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneOperationTest.java (8)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseZoneTest.java (2)
    M google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicatesTest.java (8)
    M google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/firewall_list.json (4)
    M google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/network_get.json (2)
    M google-compute-engine/src/test/resources/address_get.json (4)
    M google-compute-engine/src/test/resources/address_list.json (12)
    A google-compute-engine/src/test/resources/aggregated_instance_list.json (170)
    A google-compute-engine/src/test/resources/aggregated_instance_list_empty.json (115)
    A google-compute-engine/src/test/resources/aggregated_machinetype_list.json (58)
    M google-compute-engine/src/test/resources/disk_get.json (4)
    M google-compute-engine/src/test/resources/disk_insert_sourceImage.json (2)
    M google-compute-engine/src/test/resources/disk_insert_ssd.json (2)
    M google-compute-engine/src/test/resources/disk_list.json (8)
    M google-compute-engine/src/test/resources/firewall_get.json (4)
    M google-compute-engine/src/test/resources/firewall_insert.json (2)
    M google-compute-engine/src/test/resources/firewall_list.json (4)
    M google-compute-engine/src/test/resources/forwardingrule_get.json (6)
    M google-compute-engine/src/test/resources/forwardingrule_insert.json (2)
    M google-compute-engine/src/test/resources/forwardingrule_list.json (10)
    M google-compute-engine/src/test/resources/forwardingrule_set_target.json (2)
    M google-compute-engine/src/test/resources/global_operation.json (6)
    M google-compute-engine/src/test/resources/global_operation_list.json (10)
    M google-compute-engine/src/test/resources/image_insert_from_pd.json (2)
    M google-compute-engine/src/test/resources/instance_attach_disk.json (2)
    M google-compute-engine/src/test/resources/instance_get.json (10)
    M google-compute-engine/src/test/resources/instance_insert.json (2)
    M google-compute-engine/src/test/resources/instance_insert_simple.json (2)
    M google-compute-engine/src/test/resources/instance_list.json (14)
    M google-compute-engine/src/test/resources/instance_list_central1b_empty.json (4)
    M google-compute-engine/src/test/resources/machinetype.json (2)
    M google-compute-engine/src/test/resources/machinetype_list.json (10)
    M google-compute-engine/src/test/resources/machinetype_list_central1b.json (4)
    M google-compute-engine/src/test/resources/machinetype_list_central1b_empty.json (4)
    M google-compute-engine/src/test/resources/network_get.json (2)
    M google-compute-engine/src/test/resources/network_list.json (6)
    M google-compute-engine/src/test/resources/operation.json (10)
    M google-compute-engine/src/test/resources/operation_error.json (12)
    M google-compute-engine/src/test/resources/operation_list.json (14)
    M google-compute-engine/src/test/resources/project.json (4)
    M google-compute-engine/src/test/resources/region_get.json (6)
    M google-compute-engine/src/test/resources/region_list.json (14)
    M google-compute-engine/src/test/resources/region_operation.json (8)
    M google-compute-engine/src/test/resources/region_operation_list.json (12)
    M google-compute-engine/src/test/resources/route_get.json (6)
    M google-compute-engine/src/test/resources/route_insert.json (2)
    M google-compute-engine/src/test/resources/route_list.json (16)
    M google-compute-engine/src/test/resources/snapshot_get.json (4)
    M google-compute-engine/src/test/resources/snapshot_list.json (12)
    M google-compute-engine/src/test/resources/targetpool_addinstance.json (2)
    M google-compute-engine/src/test/resources/targetpool_changehealthcheck.json (2)
    M google-compute-engine/src/test/resources/targetpool_get.json (4)
    M google-compute-engine/src/test/resources/targetpool_list.json (8)
    M google-compute-engine/src/test/resources/targetpool_setbackup.json (2)
    M google-compute-engine/src/test/resources/zone_get.json (2)
    M google-compute-engine/src/test/resources/zone_list.json (8)
    M google-compute-engine/src/test/resources/zone_list_short.json (6)
    M google-compute-engine/src/test/resources/zone_operation.json (8)
    M google-compute-engine/src/test/resources/zone_operation_error.json (10)
    M google-compute-engine/src/test/resources/zone_operation_list.json (12)

-- Patch Links --

https://github.com/jclouds/jclouds-labs-google/pull/86.patch
https://github.com/jclouds/jclouds-labs-google/pull/86.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
running live tests again. I decided to kill that crazy InstanceTemplate class and the super-confusing json serializers.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62279102

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1662](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1662/) UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246438

Re: [jclouds-labs-google] Add aggregation apis, which remove complexity around lists and circular dep on location (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1660](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1660/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62245138

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #253](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/253/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62261208

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #254](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/254/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62261224

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
>           ImmutableMap.<Instance.Status, NodeMetadata.Status>builder()
>              .put(Instance.Status.RUNNING, NodeMetadata.Status.PENDING).build(),
>              namingConventionFactory,
> -            imageSupplier,
> +            ImmutableMap.of(instance.disks().get(0).source(), imageUrl),

Curious...why the first disk?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059919

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
>     @SerializedNames({ "fingerprint", "items" })
> -   public static Tags create(String fingerprint, List<String> items) {
> -      return new AutoValue_Tags(fingerprint, copyOf(items));
> +   static Tags create(String fingerprint, ArrayList<String> items) { // Dictates the type when created from json!

immutablelist only because we change default gson. Gson has the types I'm hard-setting here as defaults. http://code.google.com/p/google-gson/source/browse/trunk/gson/src/main/java/com/google/gson/internal/ConstructorConstructor.java

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20060271

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> +            + "      \"mode\": \"READ_WRITE\",\n" //
> +            + "      \"source\": \"" + url("/projects/party/zones/us-central1-a/disks/test-7-boot-disk") + "\",\n" //
> +            + "      \"autoDelete\": true,\n" //
> +            + "      \"boot\": true\n" //
> +            + "    }\n" + "  ],\n" //
> +            + "  \"networkInterfaces\": [\n" //
> +            + "    {\n" //
> +            + "      \"network\": \"" + url("/projects/party/networks/jclouds-test") + "\",\n" //
> +            + "      \"accessConfigs\": [\n" //
> +            + "        {\n" //
> +            + "          \"type\": \"ONE_TO_ONE_NAT\"\n" //
> +            + "        }\n" //
> +            + "      ]\n" //
> +            + "    }\n" //
> +            + "  ],\n" //
> +            + "  \"tags\": [\n" //

I used this test to see what the heck we actually do, vs clicking through a bunch of files. Using this test, I've already taken out the need for a few network calls.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20049955

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #251](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/251/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246684

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
> -         instanceTemplate.addNetworkInterface(options.getNetwork().get(), Type.ONE_TO_ONE_NAT);
> -      } else {
> -         instanceTemplate.addNetworkInterface(options.getNetwork().get());
> +      NewInstance newInstance = NewInstance.create(
> +            hardware.getUri(), // machineType
> +            name, // name
> +            options.network(), // network
> +            disks, // disks
> +            group // description
> +      );
> +
> +      // Add tags from template and for security groups
> +      newInstance.tags().items().addAll(options.getTags());
> +      FirewallTagNamingConvention naming = firewallTagNamingConvention.get(group);
> +      for (int port : options.getInboundPorts()) {
> +         newInstance.tags().items().add(naming.name(port));

Is this some kind of "convenience tagging" or something GCE already does?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059777

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
> @@ -271,95 +198,66 @@ private Disk createBootDisk(Template template, String instanceName) {
>        return Iterables.concat(images);
>     }
>  
> -   @Override
> -   public Image getImage(String id) {
> -      Image image = api.getImageApi(userProject.get()).get(id);
> -      for (int i = 0; i < imageProjects.size() && image == null; i++) {
> -          image = api.getImageApi(imageProjects.get(i)).get(id);
> -      }
> -
> -      if (image == null) {
> -          throw new NoSuchElementException("No image found with id: " + id);
> -      }
> -
> -      return image;
> +   @Override public Image getImage(String selfLink) {
> +      return resources.image(URI.create(checkNotNull(selfLink, "id")));

Should the error message here be "id"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059786

Re: [jclouds-labs-google] Add aggregation apis, which remove complexity around lists and circular dep on location (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #248](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/248/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62245001

Re: [jclouds-labs-google] Add aggregation apis, which remove complexity around lists and circular dep on location (#86)

Posted by Adrian Cole <no...@github.com>.
cc @ccustine 

ps this is line count neutral in src/main, even after adding the aggregation api

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62245049

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1673](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1673/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62313164

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Pedro Ribeiro <no...@github.com>.
@adriancole, could you please explain the change to the service accounts?

Thank you.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-100293244

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <ad...@gmail.com>.
actually, I like `api.aggregatedList().pageOfMachineTypes()` much better.

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> +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 token       marks the beginning of the next list page
> +    * @param listOptions listing options
> +    * @return a page of the list
> +    */
> +   @Named("MachineTypes:aggregatedList")
> +   @GET
> +   @Path("/machineTypes")
> +   @OAuthScopes(COMPUTE_READONLY_SCOPE)
> +   ListPage<MachineType> machineTypePage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);

Although I'm totally ok with the latter (`api.aggregatedList().pageOfMachineTypes()`), as it reads better. 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059890

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
running live tests now

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246367

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> @@ -166,4 +165,9 @@ private void getOrCreateFirewalls(GoogleComputeEngineTemplateOptions templateOpt
>                 operation);
>        }
>     }
> +
> +   private static String toName(URI link) {
> +      String path = link.getPath();
> +      return path.substring(path.lastIndexOf('/') + 1);
> +   }

Pretty soon we probably won't need to parse urls (I hope). I'd prefer to leave it for now rather than temporarily introduce a utility class.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059845

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
Same 3 live test errors as always, cannot connect to port 22. This should be solvable, possibly more easily now.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62280335

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1667](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1667/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62261562

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
>        }
>  
> -      instanceTemplate.disks(disks);
> -
> -      LoginCredentials credentials = getFromImageAndOverrideIfRequired(template.getImage(), options);
> -
> -      ImmutableMap.Builder<String, String> metadataBuilder = metatadaFromTemplateOptions.apply(options);
> -
> -      metadataBuilder.put(GCE_IMAGE_METADATA_KEY, template.getImage().getUri().toString());
> -
> -      if (!options.shouldKeepBootDisk()) {
> -         metadataBuilder.put(GCE_DELETE_BOOT_DISK_METADATA_KEY, Boolean.TRUE.toString());
> +      // Add metadata from template and for ssh key and image id
> +      newInstance.metadata().putAll(options.getUserMetadata());
> +      if (options.getPublicKey() != null) { // TODO: why are we doing this?

I don't yet understand why we are placing public key fingerprint here. There are no comments in the prior code as to why. For example, is this a google convention? Is this some default way to have the instance metadata server place a file on disk? Was this something "handy"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059823

Re: [jclouds-labs-google] Add aggregation apis, which remove complexity around lists and circular dep on location (#86)

Posted by Adrian Cole <no...@github.com>.
> @@ -33,7 +33,7 @@
>           "kind": "compute#machineType",
>           "id": "12908560709887590691",
>           "creationTimestamp": "2012-06-07T20:51:19.936",
> -         "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-8-d",
> +         "selfLink": "https://www.googleapis.com/compute/v1/projects/jclouds/zones/us-central1-a/machineTypes/n1-standard-8-d",

this change was from one arbitrary project name to a shorter one. just 2 characters prevents a lot of our line-breaks!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20049800

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
Closed #86.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#event-190490684

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
whoot. before we had a ton of separate http requests.. to create a boot disk, set metadata, set tags twice, and then the instance itself. All of the above now work in *one* request. Here's an example instance created in one operation.

```json
{
 "kind": "compute#instance",
 "id": "8935965322994729970",
 "creationTimestamp": "2014-11-08T13:22:21.085-08:00",
 "zone": "https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/us-central1-a",
 "status": "RUNNING",
 "name": "twin1-5c2",
 "description": "twin1",
 "tags": {
  "items": [
   "jclouds-twin1-port-22",
   "jclouds-twin1-port-8080"
  ],
  "fingerprint": "cXpuTuP0ZUU="
 },
 "machineType": "https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/us-central1-a/machineTypes/n1-standard-1",
 "canIpForward": false,
 "networkInterfaces": [
  {
   "network": "https://www.googleapis.com/compute/v1/projects/jclouds-dev/global/networks/jclouds-twin1",
   "networkIP": "10.8.191.227",
   "name": "nic0"
  }
 ],
 "disks": [
  {
   "kind": "compute#attachedDisk",
   "index": 0,
   "type": "PERSISTENT",
   "mode": "READ_WRITE",
   "source": "https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/us-central1-a/disks/twin1-5c2",
   "deviceName": "persistent-disk-0",
   "boot": true,
   "autoDelete": true,
   "interface": "SCSI"
  }
 ],
 "metadata": {
  "kind": "compute#metadata",
  "fingerprint": "9g5BCHRM38g=",
  "items": [
   {
    "key": "jclouds-group",
    "value": "twin1"
   }
  ]
 },
 "selfLink": "https://www.googleapis.com/compute/v1/projects/jclouds-dev/zones/us-central1-a/instances/twin1-5c2",
 "scheduling": {
  "onHostMaintenance": "MIGRATE",
  "automaticRestart": true
 }
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62279577

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #256](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/256/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62280350

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
Obviously, big changes here. I don't know the GCE provider well enough to comment on the impact or correctness of all of this. I'm fine with making the changes as this is a labs provided, but would obviously be interested to hear about what existing users think.

I've skimmed through the code and, at the level that I can evaluate, it looks good to me (only a couple of minor nits).

Thanks for all your work on this, @adriancole!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62312090

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1665](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1665/) UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62247337

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
>        }
>  
> -      instanceTemplate.disks(disks);
> -
> -      LoginCredentials credentials = getFromImageAndOverrideIfRequired(template.getImage(), options);
> -
> -      ImmutableMap.Builder<String, String> metadataBuilder = metatadaFromTemplateOptions.apply(options);
> -
> -      metadataBuilder.put(GCE_IMAGE_METADATA_KEY, template.getImage().getUri().toString());
> -
> -      if (!options.shouldKeepBootDisk()) {
> -         metadataBuilder.put(GCE_DELETE_BOOT_DISK_METADATA_KEY, Boolean.TRUE.toString());
> +      // Add metadata from template and for ssh key and image id
> +      newInstance.metadata().putAll(options.getUserMetadata());
> +      if (options.getPublicKey() != null) { // TODO: why are we doing this?

You mean "why are we not throwing an error" or "why are we supporting this option"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059784

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #255](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/255/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62279070

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
will look into the oauth things in the morning.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62247323

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
>     }
>  
> -   /**
> -    * @see #shouldKeepBootDisk()
> -    */
> -   public GoogleComputeEngineTemplateOptions keepBootDisk(boolean keepBootDisk) {
> -      this.keepBootDisk = keepBootDisk;
> -      return this;
> +   /** Additional disks to attach to this instance. */
> +   // TODO: test me or remove me!
> +   public List<URI>  additionalDisks() {

[nit] Spacing

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059808

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
@nacx @ccustine @andreaturli @danbroudy big'n but good'n

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246354

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> +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 token       marks the beginning of the next list page
> +    * @param listOptions listing options
> +    * @return a page of the list
> +    */
> +   @Named("MachineTypes:aggregatedList")
> +   @GET
> +   @Path("/machineTypes")
> +   @OAuthScopes(COMPUTE_READONLY_SCOPE)
> +   ListPage<MachineType> machineTypePage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);

oh..

this probably helps

```java
api.aggregatedList().machineTypePage()

vs.

api.aggregatedList().machineTypes()

``

Used `api.aggregatedList().machineTypePage()` as it makes the method naming more consistent than `api.aggregatedList().pageOfMachineTypes()`

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059883

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
>     @SerializedNames({ "fingerprint", "items" })
> -   public static Tags create(String fingerprint, List<String> items) {
> -      return new AutoValue_Tags(fingerprint, copyOf(items));
> +   static Tags create(String fingerprint, ArrayList<String> items) { // Dictates the type when created from json!

immutableList!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20060238

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1668](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1668/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62279206

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #260](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/260/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62312957

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> +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 token       marks the beginning of the next list page
> +    * @param listOptions listing options
> +    * @return a page of the list
> +    */
> +   @Named("MachineTypes:aggregatedList")
> +   @GET
> +   @Path("/machineTypes")
> +   @OAuthScopes(COMPUTE_READONLY_SCOPE)
> +   ListPage<MachineType> machineTypePage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);

We had a similar naming convention in this provider in the past. ListPage type currently only exists here and google storage. google storage isn't consistent with this as it still needs at least 40hrs of cleanup. The name suffix is to dodge method parameter clash with the paginated version.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059868

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1663](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1663/) UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246627

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
>     @SerializedNames({ "fingerprint", "items" })
> -   public static Tags create(String fingerprint, List<String> items) {
> -      return new AutoValue_Tags(fingerprint, copyOf(items));
> +   static Tags create(String fingerprint, ArrayList<String> items) { // Dictates the type when created from json!

Curious: which other type would/could we get if we weren't forcing ArrayList here?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059826

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1669](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1669/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62280433

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #250](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/250/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246547

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> @@ -271,95 +198,66 @@ private Disk createBootDisk(Template template, String instanceName) {
>        return Iterables.concat(images);
>     }
>  
> -   @Override
> -   public Image getImage(String id) {
> -      Image image = api.getImageApi(userProject.get()).get(id);
> -      for (int i = 0; i < imageProjects.size() && image == null; i++) {
> -          image = api.getImageApi(imageProjects.get(i)).get(id);
> -      }
> -
> -      if (image == null) {
> -          throw new NoSuchElementException("No image found with id: " + id);
> -      }
> -
> -      return image;
> +   @Override public Image getImage(String selfLink) {
> +      return resources.image(URI.create(checkNotNull(selfLink, "id")));

yeah. from the caller POV this is Image.getId(). In GCE context, id == the selfLink, hence clarifying the local parameter names.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059831

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
>           ImmutableMap.<Instance.Status, NodeMetadata.Status>builder()
>              .put(Instance.Status.RUNNING, NodeMetadata.Status.PENDING).build(),
>              namingConventionFactory,
> -            imageSupplier,
> +            ImmutableMap.of(instance.disks().get(0).source(), imageUrl),

I'll put in a comment. first disk must be the boot disk, and that's the
disk that can be derived from an image. good catch.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059936

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
>     }
>  
> -   /**
> -    * @see #shouldKeepBootDisk()
> -    */
> -   public GoogleComputeEngineTemplateOptions keepBootDisk(boolean keepBootDisk) {
> -      this.keepBootDisk = keepBootDisk;
> -      return this;
> +   /** Additional disks to attach to this instance. */
> +   // TODO: test me or remove me!
> +   public List<URI>  additionalDisks() {

weird that checkstyle didn't get this :) good catch!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059833

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #252](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/252/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62247275

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
oauth thing was just fluff in test (had double-space in authorization header). re-running live tests.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62261157

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
merged. thanks for reviewing the epic'ness, @demobox!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62313152

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1664](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1664/) UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246742

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #1666](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/1666/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62261353

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
> +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 token       marks the beginning of the next list page
> +    * @param listOptions listing options
> +    * @return a page of the list
> +    */
> +   @Named("MachineTypes:aggregatedList")
> +   @GET
> +   @Path("/machineTypes")
> +   @OAuthScopes(COMPUTE_READONLY_SCOPE)
> +   ListPage<MachineType> machineTypePage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);

Is `...Page` the convention for method names that return a `ListPage` that we've adopted elsewhere?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059834

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Andrew Phillips <no...@github.com>.
> @@ -166,4 +165,9 @@ private void getOrCreateFirewalls(GoogleComputeEngineTemplateOptions templateOpt
>                 operation);
>        }
>     }
> +
> +   private static String toName(URI link) {
> +      String path = link.getPath();
> +      return path.substring(path.lastIndexOf('/') + 1);
> +   }

I think we're repeating this in a few places...extract?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059814

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #249](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/249/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86#issuecomment-62246337

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> -         instanceTemplate.addNetworkInterface(options.getNetwork().get(), Type.ONE_TO_ONE_NAT);
> -      } else {
> -         instanceTemplate.addNetworkInterface(options.getNetwork().get());
> +      NewInstance newInstance = NewInstance.create(
> +            hardware.getUri(), // machineType
> +            name, // name
> +            options.network(), // network
> +            disks, // disks
> +            group // description
> +      );
> +
> +      // Add tags from template and for security groups
> +      newInstance.tags().items().addAll(options.getTags());
> +      FirewallTagNamingConvention naming = firewallTagNamingConvention.get(group);
> +      for (int port : options.getInboundPorts()) {
> +         newInstance.tags().items().add(naming.name(port));

This is a weird thing we are doing to track firewall rules. I hope it gets refactored out in the future.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20059820

Re: [jclouds-labs-google] Big cleanup on Google Compute Service (#86)

Posted by Adrian Cole <no...@github.com>.
> -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.features.InstanceApiExpectTest;
> -import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineServiceExpectTest;
> -import org.jclouds.http.HttpRequest;
> -import org.jclouds.http.HttpResponse;
> -import org.testng.annotations.Test;
> -
> -import com.google.common.collect.ImmutableList;
> -import com.google.common.collect.ImmutableMap;
> -import com.google.common.collect.ImmutableSet;
> -
> -@Test(groups = "unit", testName = "GoogleComputeEngineServiceExpectTest")
> -public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngineServiceExpectTest {

This deserved to die

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/86/files#r20049954