From 711e132711006eb5a63384d8f88716f8b8432616 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:02:59 -0500 Subject: [PATCH 1/2] feat: support secret and encrypted environment variables in v1 (#83) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: updated documentation for message NetworkInterface chore: published new fields in service YAML PiperOrigin-RevId: 496547510 Source-Link: https://github.com/googleapis/googleapis/commit/de57a4d09ece64bc03d12cdefc8d03278021b5be Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0b063a41cdd4748befc970f5b6405fdaf1d0470 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBiMDYzYTQxY2RkNDc0OGJlZmM5NzBmNWI2NDA1ZmRhZjFkMDQ3MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: updated documentation for message NetworkInterface chore: published new fields in service YAML PiperOrigin-RevId: 496547521 Source-Link: https://github.com/googleapis/googleapis/commit/cffce7313aadd3856058ef9c7b174165a387337e Source-Link: https://github.com/googleapis/googleapis-gen/commit/b35f4a31b293eace07aeed2a3fcf1d29db77e948 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjM1ZjRhMzFiMjkzZWFjZTA3YWVlZDJhM2ZjZjFkMjlkYjc3ZTk0OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support secret and encrypted environment variables in v1 PiperOrigin-RevId: 499338464 Source-Link: https://github.com/googleapis/googleapis/commit/af050dcf9b72d192ef20b79149a6655a9afee870 Source-Link: https://github.com/googleapis/googleapis-gen/commit/413df7a1d735359d333c56e19f6af9c7f95957e4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDEzZGY3YTFkNzM1MzU5ZDMzM2M1NmUxOWY2YWY5YzdmOTU5NTdlNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- google/cloud/batch_v1/types/job.py | 16 +++++++- google/cloud/batch_v1/types/task.py | 40 +++++++++++++++++++ google/cloud/batch_v1alpha/types/job.py | 16 +++++++- ...nippet_metadata_google.cloud.batch.v1.json | 2 +- ...t_metadata_google.cloud.batch.v1alpha.json | 2 +- .../unit/gapic/batch_v1/test_batch_service.py | 18 ++++++++- 6 files changed, 86 insertions(+), 8 deletions(-) diff --git a/google/cloud/batch_v1/types/job.py b/google/cloud/batch_v1/types/job.py index bbc4329..4df627f 100644 --- a/google/cloud/batch_v1/types/job.py +++ b/google/cloud/batch_v1/types/job.py @@ -611,9 +611,21 @@ class NetworkInterface(proto.Message): Attributes: network (str): - The URL of the network resource. + The URL of an existing network resource. + You can specify the network as a full or partial + URL. For example, the following are all valid + URLs: + https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + projects/{project}/global/networks/{network} + global/networks/{network} subnetwork (str): - The URL of the Subnetwork resource. + The URL of an existing subnetwork resource in + the network. You can specify the subnetwork as a + full or partial URL. For example, the following + are all valid URLs: + https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + projects/{project}/regions/{region}/subnetworks/{subnetwork} + regions/{region}/subnetworks/{subnetwork} no_external_ip_address (bool): Default is false (with an external IP address). Required if no external public IP diff --git a/google/cloud/batch_v1/types/task.py b/google/cloud/batch_v1/types/task.py index ec6a62c..c4ef74b 100644 --- a/google/cloud/batch_v1/types/task.py +++ b/google/cloud/batch_v1/types/task.py @@ -528,13 +528,53 @@ class Environment(proto.Message): variables (MutableMapping[str, str]): A map of environment variable names to values. + secret_variables (MutableMapping[str, str]): + A map of environment variable names to Secret + Manager secret names. The VM will access the + named secrets to set the value of each + environment variable. + encrypted_variables (google.cloud.batch_v1.types.Environment.KMSEnvMap): + An encrypted JSON dictionary where the + key/value pairs correspond to environment + variable names and their values. """ + class KMSEnvMap(proto.Message): + r""" + + Attributes: + key_name (str): + The name of the KMS key that will be used to + decrypt the cipher text. + cipher_text (str): + The value of the cipherText response from the ``encrypt`` + method. + """ + + key_name: str = proto.Field( + proto.STRING, + number=1, + ) + cipher_text: str = proto.Field( + proto.STRING, + number=2, + ) + variables: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=1, ) + secret_variables: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) + encrypted_variables: KMSEnvMap = proto.Field( + proto.MESSAGE, + number=3, + message=KMSEnvMap, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/batch_v1alpha/types/job.py b/google/cloud/batch_v1alpha/types/job.py index cfca93b..8cf361a 100644 --- a/google/cloud/batch_v1alpha/types/job.py +++ b/google/cloud/batch_v1alpha/types/job.py @@ -713,9 +713,21 @@ class NetworkInterface(proto.Message): Attributes: network (str): - The URL of the network resource. + The URL of an existing network resource. + You can specify the network as a full or partial + URL. For example, the following are all valid + URLs: + https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + projects/{project}/global/networks/{network} + global/networks/{network} subnetwork (str): - The URL of the Subnetwork resource. + The URL of an existing subnetwork resource in + the network. You can specify the subnetwork as a + full or partial URL. For example, the following + are all valid URLs: + https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + projects/{project}/regions/{region}/subnetworks/{subnetwork} + regions/{region}/subnetworks/{subnetwork} no_external_ip_address (bool): Default is false (with an external IP address). Required if no external public IP diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index e34bdd0..e2df106 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.6.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index 6bd2d6c..4862cc9 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.6.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/tests/unit/gapic/batch_v1/test_batch_service.py b/tests/unit/gapic/batch_v1/test_batch_service.py index cd434c0..0bd1bb9 100644 --- a/tests/unit/gapic/batch_v1/test_batch_service.py +++ b/tests/unit/gapic/batch_v1/test_batch_service.py @@ -2543,7 +2543,14 @@ def test_create_job_rest(request_type): "ignore_exit_status": True, "background": True, "always_run": True, - "environment": {"variables": {}}, + "environment": { + "variables": {}, + "secret_variables": {}, + "encrypted_variables": { + "key_name": "key_name_value", + "cipher_text": "cipher_text_value", + }, + }, "timeout": {"seconds": 751, "nanos": 543}, } ], @@ -2878,7 +2885,14 @@ def test_create_job_rest_bad_request( "ignore_exit_status": True, "background": True, "always_run": True, - "environment": {"variables": {}}, + "environment": { + "variables": {}, + "secret_variables": {}, + "encrypted_variables": { + "key_name": "key_name_value", + "cipher_text": "cipher_text_value", + }, + }, "timeout": {"seconds": 751, "nanos": 543}, } ], From c4a53d2bbff48ee2d774c92157b8f27f76e0f636 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:44:48 -0500 Subject: [PATCH 2/2] chore(main): release 0.7.0 (#84) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ google/cloud/batch/gapic_version.py | 2 +- google/cloud/batch_v1/gapic_version.py | 2 +- google/cloud/batch_v1alpha/gapic_version.py | 2 +- .../snippet_metadata_google.cloud.batch.v1.json | 2 +- .../snippet_metadata_google.cloud.batch.v1alpha.json | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bcd0522..e7ca613 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.7.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d894e0..1dec77d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.7.0](https://github.com/googleapis/python-batch/compare/v0.6.0...v0.7.0) (2023-01-04) + + +### Features + +* Support secret and encrypted environment variables in v1 ([711e132](https://github.com/googleapis/python-batch/commit/711e132711006eb5a63384d8f88716f8b8432616)) + + +### Documentation + +* Updated documentation for message NetworkInterface ([711e132](https://github.com/googleapis/python-batch/commit/711e132711006eb5a63384d8f88716f8b8432616)) + ## [0.6.0](https://github.com/googleapis/python-batch/compare/v0.5.0...v0.6.0) (2022-12-15) diff --git a/google/cloud/batch/gapic_version.py b/google/cloud/batch/gapic_version.py index 06b4a76..e341813 100644 --- a/google/cloud/batch/gapic_version.py +++ b/google/cloud/batch/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.6.0" # {x-release-please-version} +__version__ = "0.7.0" # {x-release-please-version} diff --git a/google/cloud/batch_v1/gapic_version.py b/google/cloud/batch_v1/gapic_version.py index 06b4a76..e341813 100644 --- a/google/cloud/batch_v1/gapic_version.py +++ b/google/cloud/batch_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.6.0" # {x-release-please-version} +__version__ = "0.7.0" # {x-release-please-version} diff --git a/google/cloud/batch_v1alpha/gapic_version.py b/google/cloud/batch_v1alpha/gapic_version.py index 06b4a76..e341813 100644 --- a/google/cloud/batch_v1alpha/gapic_version.py +++ b/google/cloud/batch_v1alpha/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.6.0" # {x-release-please-version} +__version__ = "0.7.0" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index e2df106..b47c9b7 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.1.0" + "version": "0.7.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index 4862cc9..30941ff 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.1.0" + "version": "0.7.0" }, "snippets": [ {