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}, } ],