diff --git a/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/types/cloud_tpu.py b/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/types/cloud_tpu.py index 0a4e2b0ddbae..f2fab8a58751 100644 --- a/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/types/cloud_tpu.py +++ b/packages/google-cloud-tpu/google/cloud/tpu_v2alpha1/types/cloud_tpu.py @@ -396,6 +396,9 @@ class Node(proto.Message): The AccleratorConfig for the TPU Node. shielded_instance_config (google.cloud.tpu_v2alpha1.types.ShieldedInstanceConfig): Shielded Instance options. + multislice_node (bool): + Output only. Whether the Node belongs to a + Multislice group. """ class State(proto.Enum): @@ -603,6 +606,10 @@ class ApiVersion(proto.Enum): number=45, message="ShieldedInstanceConfig", ) + multislice_node: bool = proto.Field( + proto.BOOL, + number=47, + ) class QueuedResource(proto.Message): @@ -1317,6 +1324,14 @@ class DeleteQueuedResourceRequest(proto.Message): Required. The resource name. request_id (str): Idempotent request UUID. + force (bool): + If set to true, all running nodes belonging + to this queued resource will be deleted first + and then the queued resource will be deleted. + Otherwise (i.e. force=false), the queued + resource will only be deleted if its nodes have + already been deleted or the queued resource is + in the ACCEPTED, FAILED, or SUSPENDED state. """ name: str = proto.Field( @@ -1327,6 +1342,10 @@ class DeleteQueuedResourceRequest(proto.Message): proto.STRING, number=2, ) + force: bool = proto.Field( + proto.BOOL, + number=3, + ) class ServiceIdentity(proto.Message): diff --git a/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v1.json b/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v1.json index f61ededa1fb6..0a659a05f598 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v1.json +++ b/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tpu", - "version": "1.10.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2.json b/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2.json index 0d5e082f17bb..9f7e7c8961fc 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2.json +++ b/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tpu", - "version": "1.10.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2alpha1.json b/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2alpha1.json index 21bb2d3334aa..25123541f80c 100644 --- a/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2alpha1.json +++ b/packages/google-cloud-tpu/samples/generated_samples/snippet_metadata_google.cloud.tpu.v2alpha1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tpu", - "version": "1.10.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-tpu/scripts/fixup_tpu_v2alpha1_keywords.py b/packages/google-cloud-tpu/scripts/fixup_tpu_v2alpha1_keywords.py index b2f15db3d769..7f9a7b8b2063 100644 --- a/packages/google-cloud-tpu/scripts/fixup_tpu_v2alpha1_keywords.py +++ b/packages/google-cloud-tpu/scripts/fixup_tpu_v2alpha1_keywords.py @@ -42,7 +42,7 @@ class tpuCallTransformer(cst.CSTTransformer): 'create_node': ('parent', 'node', 'node_id', 'request_id', ), 'create_queued_resource': ('parent', 'queued_resource', 'queued_resource_id', 'request_id', ), 'delete_node': ('name', 'request_id', ), - 'delete_queued_resource': ('name', 'request_id', ), + 'delete_queued_resource': ('name', 'request_id', 'force', ), 'generate_service_identity': ('parent', ), 'get_accelerator_type': ('name', ), 'get_guest_attributes': ('name', 'query_path', 'worker_ids', ), diff --git a/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py index b57f5a69be03..fb23fd0c461c 100644 --- a/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py +++ b/packages/google-cloud-tpu/tests/unit/gapic/tpu_v2alpha1/test_tpu.py @@ -1092,6 +1092,7 @@ def test_get_node(request_type, transport: str = "grpc"): id=205, api_version=cloud_tpu.Node.ApiVersion.V1_ALPHA1, queued_resource="queued_resource_value", + multislice_node=True, ) response = client.get_node(request) @@ -1114,6 +1115,7 @@ def test_get_node(request_type, transport: str = "grpc"): assert response.id == 205 assert response.api_version == cloud_tpu.Node.ApiVersion.V1_ALPHA1 assert response.queued_resource == "queued_resource_value" + assert response.multislice_node is True def test_get_node_empty_call(): @@ -1162,6 +1164,7 @@ async def test_get_node_async( id=205, api_version=cloud_tpu.Node.ApiVersion.V1_ALPHA1, queued_resource="queued_resource_value", + multislice_node=True, ) ) response = await client.get_node(request) @@ -1185,6 +1188,7 @@ async def test_get_node_async( assert response.id == 205 assert response.api_version == cloud_tpu.Node.ApiVersion.V1_ALPHA1 assert response.queued_resource == "queued_resource_value" + assert response.multislice_node is True @pytest.mark.asyncio