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_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/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/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..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.6.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 6bd2d6c..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.6.0" + "version": "0.7.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}, } ],