diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 626250a9f..14f3ec99a 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-compute.git", - "sha": "f9f56b2675a0dfca55c28c486dabcbea5af52cf9" + "sha": "0f9ac8e9c475373fa5dd7700381b17b1fa098720" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3d32990b6f4b57be77455e3ca89e6e21cd0c06b3" + "sha": "484b7ec7bdef3909589a83e3d763e7588cb8c37c" } } ] diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 392d71004..5ad29fa60 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -115,7 +115,7 @@ fi # fix output location of logs bash .kokoro/coerce_logs.sh -if [[ "${ENABLE_BUILD_COP}" == "true" ]] +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] then chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-compute diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index 0048c8ece..e51c7b4c6 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -22,7 +22,7 @@ env_vars: { } env_vars: { - key: "ENABLE_BUILD_COP" + key: "ENABLE_FLAKYBOT" value: "true" } diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index f25429314..9761fd864 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -33,6 +33,6 @@ env_vars: { } env_vars: { - key: "ENABLE_BUILD_COP" + key: "ENABLE_FLAKYBOT" value: "true" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 92196912c..7015337d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.1](https://www.github.com/googleapis/java-compute/compare/v1.4.0...v1.4.1) (2021-08-23) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#515](https://www.github.com/googleapis/java-compute/issues/515)) ([12c6bc9](https://www.github.com/googleapis/java-compute/commit/12c6bc9a890959c29f4545b7b784b940d6d2f28f)) + ## [1.4.0](https://www.github.com/googleapis/java-compute/compare/v1.3.0...v1.4.0) (2021-08-11) ### Dependencies diff --git a/README.md b/README.md index 6b112b345..e191d085b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-compute - 1.3.0-alpha + 1.4.0-alpha ``` @@ -30,13 +30,13 @@ If you are using Maven, add this to your pom.xml file: If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-compute:1.3.0-alpha' +compile 'com.google.cloud:google-cloud-compute:1.4.0-alpha' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "1.3.0-alpha" +libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "1.4.0-alpha" ``` ## Authentication diff --git a/google-cloud-compute-bom/pom.xml b/google-cloud-compute-bom/pom.xml index ef31caee7..9912fb96d 100644 --- a/google-cloud-compute-bom/pom.xml +++ b/google-cloud-compute-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-compute-bom - 1.4.0-alpha + 1.4.1-alpha pom com.google.cloud google-cloud-shared-config - 1.0.0 + 1.0.1 Google Compute Engine BOM @@ -53,12 +53,12 @@ com.google.cloud google-cloud-compute - 1.4.0-alpha + 1.4.1-alpha com.google.api.grpc proto-google-cloud-compute-v1 - 1.4.0-alpha + 1.4.1-alpha diff --git a/google-cloud-compute/pom.xml b/google-cloud-compute/pom.xml index c50c483ee..c952fbe8b 100644 --- a/google-cloud-compute/pom.xml +++ b/google-cloud-compute/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.google.cloud google-cloud-compute - 1.4.0-alpha + 1.4.1-alpha jar Google Compute Engine https://github.com/googleapis/java-compute @@ -15,7 +15,7 @@ com.google.cloud google-cloud-compute-parent - 1.4.0-alpha + 1.4.1-alpha google-cloud-compute diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITPaginationTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITPaginationTest.java index 6d584f204..05901e9cc 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITPaginationTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITPaginationTest.java @@ -15,12 +15,17 @@ */ package com.google.cloud.compute.v1.integration; +import com.google.cloud.compute.v1.AcceleratorType; +import com.google.cloud.compute.v1.AcceleratorTypesClient; +import com.google.cloud.compute.v1.AcceleratorTypesScopedList; +import com.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest; import com.google.cloud.compute.v1.ListZonesRequest; import com.google.cloud.compute.v1.Zone; import com.google.cloud.compute.v1.ZonesClient; import com.google.cloud.compute.v1.ZonesSettings; import com.google.common.collect.Lists; import java.io.IOException; +import java.util.Map; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; @@ -116,4 +121,28 @@ public void testPaginationIterating() { } Assert.assertTrue(presented); } + + @Test + public void testPaginationAggregatedIterating() throws IOException { + AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.create(); + AggregatedListAcceleratorTypesRequest aggregatedListAcceleratorTypesRequest = + AggregatedListAcceleratorTypesRequest.newBuilder() + .setProject(DEFAULT_PROJECT) + .setMaxResults(2) + .build(); + AcceleratorTypesClient.AggregatedListPagedResponse response = + acceleratorTypesClient.aggregatedList(aggregatedListAcceleratorTypesRequest); + boolean presented = false; + for (Map.Entry entry : response.iterateAll()) { + if (entry.getKey().equals("zones/" + DEFAULT_ZONE)) { + for (AcceleratorType type : entry.getValue().getAcceleratorTypesList()) { + if (type.getName().equals("nvidia-tesla-t4")) { + presented = true; + break; + } + } + } + } + Assert.assertTrue(presented); + } } diff --git a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITSmokeInstancesTest.java b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITSmokeInstancesTest.java index b75452a0b..041261c6a 100644 --- a/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITSmokeInstancesTest.java +++ b/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITSmokeInstancesTest.java @@ -19,9 +19,14 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.NotFoundException; +import com.google.cloud.compute.v1.Allowed; import com.google.cloud.compute.v1.AttachedDisk; import com.google.cloud.compute.v1.AttachedDiskInitializeParams; +import com.google.cloud.compute.v1.Firewall; +import com.google.cloud.compute.v1.FirewallsClient; import com.google.cloud.compute.v1.GetInstanceRequest; +import com.google.cloud.compute.v1.Image; +import com.google.cloud.compute.v1.ImagesClient; import com.google.cloud.compute.v1.Instance; import com.google.cloud.compute.v1.InstanceGroupManager; import com.google.cloud.compute.v1.InstanceGroupManagersClient; @@ -37,6 +42,7 @@ import com.google.cloud.compute.v1.ZoneOperationsSettings; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; import org.junit.AfterClass; @@ -237,6 +243,53 @@ public void testApiError() { } } + @Test + public void testInt64() throws IOException { + // we want to test a field with format:int64 + String name = generateRandomName("image"); + List licenseCodes = Collections.singletonList(5543610867827062957L); + String sourceImage = "projects/debian-cloud/global/images/debian-10-buster-v20210721"; + ImagesClient imagesClient = ImagesClient.create(); + Image image = + Image.newBuilder() + .setName(name) + .addAllLicenseCodes(licenseCodes) + .setSourceImage(sourceImage) + .build(); + try { + Operation op = imagesClient.insert(DEFAULT_PROJECT, image); + waitGlobalOperation(op); + + Image fetched = imagesClient.get(DEFAULT_PROJECT, name); + Assert.assertEquals(licenseCodes, fetched.getLicenseCodesList()); + } finally { + imagesClient.delete(DEFAULT_PROJECT, name); + } + } + + @Test + public void testCapitalLetterField() throws IOException { + // we want to test a field like "IPProtocol" + String name = generateRandomName("fw-rule"); + FirewallsClient firewallsClient = FirewallsClient.create(); + Firewall firewall = + Firewall.newBuilder() + .setName(name) + .addAllowed(Allowed.newBuilder().setIPProtocol("tcp").addPorts("80").build()) + .addSourceRanges("0.0.0.0/0") + .build(); + try { + Operation op = firewallsClient.insert(DEFAULT_PROJECT, firewall); + waitGlobalOperation(op); + + Firewall fetched = firewallsClient.get(DEFAULT_PROJECT, name); + Assert.assertEquals(name, fetched.getName()); + Assert.assertEquals("tcp", fetched.getAllowed(0).getIPProtocol()); + } finally { + firewallsClient.delete(DEFAULT_PROJECT, name); + } + } + @Ignore("Patch is not supported") @Test public void testPatch() { diff --git a/pom.xml b/pom.xml index 33c8d697a..3aece4c6d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-compute-parent pom - 1.4.0-alpha + 1.4.1-alpha Google Compute Engine Parent https://github.com/googleapis/java-compute @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.0.0 + 1.0.1 @@ -61,18 +61,18 @@ com.google.cloud google-cloud-compute - 1.4.0-alpha + 1.4.1-alpha com.google.api.grpc proto-google-cloud-compute-v1 - 1.4.0-alpha + 1.4.1-alpha com.google.cloud google-cloud-shared-dependencies - 2.0.1 + 2.1.0 pom import diff --git a/proto-google-cloud-compute-v1/pom.xml b/proto-google-cloud-compute-v1/pom.xml index 570e7e085..6840b3048 100644 --- a/proto-google-cloud-compute-v1/pom.xml +++ b/proto-google-cloud-compute-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-compute-v1 - 1.4.0-alpha + 1.4.1-alpha proto-google-cloud-compute-v1 Proto library for google-cloud-compute com.google.cloud google-cloud-compute-parent - 1.4.0-alpha + 1.4.1-alpha diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e14e48419..aed524a60 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-compute - 1.3.0-alpha + 1.4.0-alpha diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bf39c1e45..c0003941b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-compute - 1.3.0-alpha + 1.4.0-alpha diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 660b85515..980175e30 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-compute - 1.3.0-alpha + 1.4.0-alpha diff --git a/synth.metadata b/synth.metadata index 4f1e9d6b9..0c9c97252 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-compute.git", - "sha": "94d055e7e660d74d9a8defa52003437bdff003b4" + "sha": "0a54cf716cfb522538dd6a16f24286e36baadc84" } }, { @@ -18,7 +18,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a2878d6909dd10ca4e3c1b5943d6622e996054e" + "sha": "ff01716e16d2c6e87eaf87197b753ac9fcbbed5d" } } ], diff --git a/versions.txt b/versions.txt index 2d7e56ad0..62403ca97 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-compute:1.4.0-alpha:1.4.0-alpha -proto-google-cloud-compute-v1:1.4.0-alpha:1.4.0-alpha -grpc-google-cloud-compute-v1:1.4.0-alpha:1.4.0-alpha +google-cloud-compute:1.4.1-alpha:1.4.1-alpha +proto-google-cloud-compute-v1:1.4.1-alpha:1.4.1-alpha +grpc-google-cloud-compute-v1:1.4.1-alpha:1.4.1-alpha