From d13f3427f4a6dbe09f8a13650861d87b5a0cf767 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 4 Jul 2022 17:50:26 +0000 Subject: [PATCH 01/31] feat: generate v1 --- ...enerated_batch_service_create_job_async.py | 45 + ...generated_batch_service_create_job_sync.py | 45 + ...enerated_batch_service_delete_job_async.py | 48 + ...generated_batch_service_delete_job_sync.py | 48 + ...1_generated_batch_service_get_job_async.py | 45 + ...v1_generated_batch_service_get_job_sync.py | 45 + ..._generated_batch_service_get_task_async.py | 45 + ...1_generated_batch_service_get_task_sync.py | 45 + ...generated_batch_service_list_jobs_async.py | 45 + ..._generated_batch_service_list_jobs_sync.py | 45 + ...enerated_batch_service_list_tasks_async.py | 46 + ...generated_batch_service_list_tasks_sync.py | 46 + .../snippet_metadata_batch_v1.json | 996 ++++++++++++++++++ 13 files changed, 1544 insertions(+) create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py create mode 100644 compute/batch/generated_samples/snippet_metadata_batch_v1.json diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py new file mode 100644 index 000000000000..b8b5d54ff227 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_CreateJob_async] +from google.cloud import batch_v1 + + +async def sample_create_job(): + # Create a client + client = batch_v1.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_CreateJob_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py new file mode 100644 index 000000000000..bf4685c4e015 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_CreateJob_sync] +from google.cloud import batch_v1 + + +def sample_create_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py new file mode 100644 index 000000000000..5d64e17b5db9 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_DeleteJob_async] +from google.cloud import batch_v1 + + +async def sample_delete_job(): + # Create a client + client = batch_v1.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_DeleteJob_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py new file mode 100644 index 000000000000..4546488874e9 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_DeleteJob_sync] +from google.cloud import batch_v1 + + +def sample_delete_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py new file mode 100644 index 000000000000..c73717f1f842 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetJob_async] +from google.cloud import batch_v1 + + +async def sample_get_job(): + # Create a client + client = batch_v1.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1.GetJobRequest( + name="name_value", + ) + + # Make the request + response = await client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetJob_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py new file mode 100644 index 000000000000..fe53c50504fe --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetJob_sync] +from google.cloud import batch_v1 + + +def sample_get_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.GetJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py new file mode 100644 index 000000000000..fc7304823455 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetTask_async] +from google.cloud import batch_v1 + + +async def sample_get_task(): + # Create a client + client = batch_v1.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetTask_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py new file mode 100644 index 000000000000..064946555379 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetTask_sync] +from google.cloud import batch_v1 + + +def sample_get_task(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py new file mode 100644 index 000000000000..6053925f1dee --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListJobs_async] +from google.cloud import batch_v1 + + +async def sample_list_jobs(): + # Create a client + client = batch_v1.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListJobs_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py new file mode 100644 index 000000000000..47dd7ecc22a0 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListJobs_sync] +from google.cloud import batch_v1 + + +def sample_list_jobs(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py new file mode 100644 index 000000000000..51681d9def0a --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListTasks_async] +from google.cloud import batch_v1 + + +async def sample_list_tasks(): + # Create a client + client = batch_v1.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListTasks_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py new file mode 100644 index 000000000000..d888a5724170 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListTasks_sync] +from google.cloud import batch_v1 + + +def sample_list_tasks(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json new file mode 100644 index 000000000000..71090edebbaa --- /dev/null +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1.json @@ -0,0 +1,996 @@ +{ + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.batch.v1", + "version": "v1" + } + ], + "language": "PYTHON", + "name": "google-cloud-batch" + }, + "snippets": [ + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.create_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "CreateJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.batch_v1.types.Job" + }, + { + "name": "job_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Job", + "shortName": "create_job" + }, + "description": "Sample for CreateJob", + "file": "batch_v1_generated_batch_service_create_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_CreateJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_create_job_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.create_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "CreateJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.batch_v1.types.Job" + }, + { + "name": "job_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Job", + "shortName": "create_job" + }, + "description": "Sample for CreateJob", + "file": "batch_v1_generated_batch_service_create_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_create_job_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.delete_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "DeleteJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_job" + }, + "description": "Sample for DeleteJob", + "file": "batch_v1_generated_batch_service_delete_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_delete_job_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.delete_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "DeleteJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_job" + }, + "description": "Sample for DeleteJob", + "file": "batch_v1_generated_batch_service_delete_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_delete_job_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.get_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Job", + "shortName": "get_job" + }, + "description": "Sample for GetJob", + "file": "batch_v1_generated_batch_service_get_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_GetJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_get_job_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.get_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Job", + "shortName": "get_job" + }, + "description": "Sample for GetJob", + "file": "batch_v1_generated_batch_service_get_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_GetJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_get_job_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.get_task", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetTask" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Task", + "shortName": "get_task" + }, + "description": "Sample for GetTask", + "file": "batch_v1_generated_batch_service_get_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_GetTask_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_get_task_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.get_task", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetTask" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Task", + "shortName": "get_task" + }, + "description": "Sample for GetTask", + "file": "batch_v1_generated_batch_service_get_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_GetTask_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_get_task_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.list_jobs", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListJobs" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListJobsAsyncPager", + "shortName": "list_jobs" + }, + "description": "Sample for ListJobs", + "file": "batch_v1_generated_batch_service_list_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_ListJobs_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_list_jobs_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.list_jobs", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListJobs" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListJobsPager", + "shortName": "list_jobs" + }, + "description": "Sample for ListJobs", + "file": "batch_v1_generated_batch_service_list_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_list_jobs_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.list_tasks", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListTasks" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListTasksAsyncPager", + "shortName": "list_tasks" + }, + "description": "Sample for ListTasks", + "file": "batch_v1_generated_batch_service_list_tasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_ListTasks_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_list_tasks_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.list_tasks", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListTasks" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListTasksPager", + "shortName": "list_tasks" + }, + "description": "Sample for ListTasks", + "file": "batch_v1_generated_batch_service_list_tasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_list_tasks_sync.py" + } + ] +} From 0bb14cee00879ca10c51c22a7ce005d88d9a40d2 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 31 Aug 2022 12:54:15 -0400 Subject: [PATCH 02/31] feat: generate v1alpha (#25) --- ...enerated_batch_service_create_job_async.py | 45 + ...generated_batch_service_create_job_sync.py | 45 + ...enerated_batch_service_delete_job_async.py | 48 + ...generated_batch_service_delete_job_sync.py | 48 + ...a_generated_batch_service_get_job_async.py | 45 + ...ha_generated_batch_service_get_job_sync.py | 45 + ..._generated_batch_service_get_task_async.py | 45 + ...a_generated_batch_service_get_task_sync.py | 45 + ...generated_batch_service_list_jobs_async.py | 45 + ..._generated_batch_service_list_jobs_sync.py | 45 + ...enerated_batch_service_list_tasks_async.py | 46 + ...generated_batch_service_list_tasks_sync.py | 46 + .../snippet_metadata_batch_v1alpha.json | 996 ++++++++++++++++++ 13 files changed, 1544 insertions(+) create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py create mode 100644 compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py new file mode 100644 index 000000000000..1d89197ecbdc --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_CreateJob_async] +from google.cloud import batch_v1alpha + + +async def sample_create_job(): + # Create a client + client = batch_v1alpha.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1alpha.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_CreateJob_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py new file mode 100644 index 000000000000..39e581ffb48d --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_CreateJob_sync] +from google.cloud import batch_v1alpha + + +def sample_create_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_CreateJob_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py new file mode 100644 index 000000000000..6f4e7ee592f6 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_DeleteJob_async] +from google.cloud import batch_v1alpha + + +async def sample_delete_job(): + # Create a client + client = batch_v1alpha.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1alpha.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_DeleteJob_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py new file mode 100644 index 000000000000..7bb7b4ddf834 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_DeleteJob_sync] +from google.cloud import batch_v1alpha + + +def sample_delete_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_DeleteJob_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py new file mode 100644 index 000000000000..ff9f93835de0 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetJob_async] +from google.cloud import batch_v1alpha + + +async def sample_get_job(): + # Create a client + client = batch_v1alpha.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetJobRequest( + name="name_value", + ) + + # Make the request + response = await client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetJob_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py new file mode 100644 index 000000000000..07a0f0fd7619 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetJob_sync] +from google.cloud import batch_v1alpha + + +def sample_get_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetJob_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py new file mode 100644 index 000000000000..6f5471fae939 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetTask_async] +from google.cloud import batch_v1alpha + + +async def sample_get_task(): + # Create a client + client = batch_v1alpha.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetTask_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py new file mode 100644 index 000000000000..1a36eda5b9a5 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetTask_sync] +from google.cloud import batch_v1alpha + + +def sample_get_task(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetTask_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py new file mode 100644 index 000000000000..39f3b90638dd --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListJobs_async] +from google.cloud import batch_v1alpha + + +async def sample_list_jobs(): + # Create a client + client = batch_v1alpha.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListJobs_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py new file mode 100644 index 000000000000..ed142e875ae7 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListJobs_sync] +from google.cloud import batch_v1alpha + + +def sample_list_jobs(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListJobs_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py new file mode 100644 index 000000000000..8ecdaa4f427d --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListTasks_async] +from google.cloud import batch_v1alpha + + +async def sample_list_tasks(): + # Create a client + client = batch_v1alpha.BatchServiceAsyncClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListTasks_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py new file mode 100644 index 000000000000..b2b4f4854736 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListTasks_sync] +from google.cloud import batch_v1alpha + + +def sample_list_tasks(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListTasks_sync] diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json new file mode 100644 index 000000000000..329b3e37f0d2 --- /dev/null +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -0,0 +1,996 @@ +{ + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.batch.v1alpha", + "version": "v1alpha" + } + ], + "language": "PYTHON", + "name": "google-cloud-batch" + }, + "snippets": [ + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.create_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "CreateJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.batch_v1alpha.types.Job" + }, + { + "name": "job_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Job", + "shortName": "create_job" + }, + "description": "Sample for CreateJob", + "file": "batch_v1alpha_generated_batch_service_create_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_create_job_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.create_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "CreateJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.batch_v1alpha.types.Job" + }, + { + "name": "job_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Job", + "shortName": "create_job" + }, + "description": "Sample for CreateJob", + "file": "batch_v1alpha_generated_batch_service_create_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_create_job_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.delete_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "DeleteJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_job" + }, + "description": "Sample for DeleteJob", + "file": "batch_v1alpha_generated_batch_service_delete_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_delete_job_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.delete_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "DeleteJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_job" + }, + "description": "Sample for DeleteJob", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_delete_job_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.get_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Job", + "shortName": "get_job" + }, + "description": "Sample for GetJob", + "file": "batch_v1alpha_generated_batch_service_get_job_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_get_job_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Job", + "shortName": "get_job" + }, + "description": "Sample for GetJob", + "file": "batch_v1alpha_generated_batch_service_get_job_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_get_job_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.get_task", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetTask" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Task", + "shortName": "get_task" + }, + "description": "Sample for GetTask", + "file": "batch_v1alpha_generated_batch_service_get_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_get_task_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_task", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetTask" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Task", + "shortName": "get_task" + }, + "description": "Sample for GetTask", + "file": "batch_v1alpha_generated_batch_service_get_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_get_task_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.list_jobs", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListJobs" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListJobsAsyncPager", + "shortName": "list_jobs" + }, + "description": "Sample for ListJobs", + "file": "batch_v1alpha_generated_batch_service_list_jobs_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_list_jobs_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_jobs", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListJobs" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListJobsPager", + "shortName": "list_jobs" + }, + "description": "Sample for ListJobs", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", + "shortName": "BatchServiceAsyncClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.list_tasks", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListTasks" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListTasksAsyncPager", + "shortName": "list_tasks" + }, + "description": "Sample for ListTasks", + "file": "batch_v1alpha_generated_batch_service_list_tasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_list_tasks_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_tasks", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListTasks" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListTasksPager", + "shortName": "list_tasks" + }, + "description": "Sample for ListTasks", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync.py" + } + ] +} From 4b067832c5785b5b36737887236116bcd2586cd0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:56:18 +0000 Subject: [PATCH 03/31] chore: Bump gapic-generator-python version to 1.3.0 (#32) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 472561635 Source-Link: https://github.com/googleapis/googleapis/commit/332ecf599f8e747d8d1213b77ae7db26eff12814 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4313d682880fd9d7247291164d4e9d3d5bd9f177 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9 --- ...enerated_batch_service_create_job_async.py | 7 + ...generated_batch_service_create_job_sync.py | 7 + ...enerated_batch_service_delete_job_async.py | 7 + ...generated_batch_service_delete_job_sync.py | 7 + ...1_generated_batch_service_get_job_async.py | 7 + ...v1_generated_batch_service_get_job_sync.py | 7 + ..._generated_batch_service_get_task_async.py | 7 + ...1_generated_batch_service_get_task_sync.py | 7 + ...generated_batch_service_list_jobs_async.py | 7 + ..._generated_batch_service_list_jobs_sync.py | 7 + ...enerated_batch_service_list_tasks_async.py | 7 + ...generated_batch_service_list_tasks_sync.py | 7 + ...enerated_batch_service_create_job_async.py | 7 + ...generated_batch_service_create_job_sync.py | 7 + ...enerated_batch_service_delete_job_async.py | 7 + ...generated_batch_service_delete_job_sync.py | 7 + ...a_generated_batch_service_get_job_async.py | 7 + ...ha_generated_batch_service_get_job_sync.py | 7 + ..._generated_batch_service_get_task_async.py | 7 + ...a_generated_batch_service_get_task_sync.py | 7 + ...generated_batch_service_list_jobs_async.py | 7 + ..._generated_batch_service_list_jobs_sync.py | 7 + ...enerated_batch_service_list_tasks_async.py | 7 + ...generated_batch_service_list_tasks_sync.py | 7 + .../snippet_metadata_batch_v1.json | 240 +++++++++--------- .../snippet_metadata_batch_v1alpha.json | 240 +++++++++--------- 26 files changed, 408 insertions(+), 240 deletions(-) diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py index b8b5d54ff227..eb8d4756edd1 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_CreateJob_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py index bf4685c4e015..77f1ed0c5597 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_CreateJob_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py index 5d64e17b5db9..0af8acf09dfd 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_DeleteJob_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py index 4546488874e9..bdd382155152 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_DeleteJob_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py index c73717f1f842..bacea0617874 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_GetJob_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py index fe53c50504fe..c4e818944068 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_GetJob_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py index fc7304823455..154dc79cb70a 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_GetTask_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py index 064946555379..059a72f903e7 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_GetTask_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py index 6053925f1dee..db637c1d4850 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_ListJobs_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py index 47dd7ecc22a0..83dfb69e0bb6 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_ListJobs_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py index 51681d9def0a..6e90626ef126 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_ListTasks_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py index d888a5724170..79e02ba0cbdc 100644 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py @@ -24,6 +24,13 @@ # [START batch_v1_generated_BatchService_ListTasks_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1 diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py index 1d89197ecbdc..b1602d7d9304 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_CreateJob_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py index 39e581ffb48d..17a89f9903e7 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_CreateJob_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py index 6f4e7ee592f6..03efd1c7c02e 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_DeleteJob_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py index 7bb7b4ddf834..b47ca5e80391 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_DeleteJob_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py index ff9f93835de0..0b96db97f5ec 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_GetJob_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py index 07a0f0fd7619..9a56b6501258 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_GetJob_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py index 6f5471fae939..99e13d83ebcd 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_GetTask_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py index 1a36eda5b9a5..bf8528fd8763 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_GetTask_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py index 39f3b90638dd..ea3b0726fbd6 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_ListJobs_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py index ed142e875ae7..8a7a73898461 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_ListJobs_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py index 8ecdaa4f427d..a3f7cdf0fec8 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_ListTasks_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py index b2b4f4854736..1e2f6c3099de 100644 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py @@ -24,6 +24,13 @@ # [START batch_v1alpha_generated_BatchService_ListTasks_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html from google.cloud import batch_v1alpha diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json index 71090edebbaa..bc11c0d177e3 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1.json @@ -67,33 +67,33 @@ "regionTag": "batch_v1_generated_BatchService_CreateJob_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -155,33 +155,33 @@ "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -236,33 +236,33 @@ "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", "segments": [ { - "end": 47, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 47, + "end": 54, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 44, - "start": 38, + "end": 51, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 48, - "start": 45, + "end": 55, + "start": 52, "type": "RESPONSE_HANDLING" } ], @@ -316,33 +316,33 @@ "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", "segments": [ { - "end": 47, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 47, + "end": 54, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 44, - "start": 38, + "end": 51, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 48, - "start": 45, + "end": 55, + "start": 52, "type": "RESPONSE_HANDLING" } ], @@ -397,33 +397,33 @@ "regionTag": "batch_v1_generated_BatchService_GetJob_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -477,33 +477,33 @@ "regionTag": "batch_v1_generated_BatchService_GetJob_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -558,33 +558,33 @@ "regionTag": "batch_v1_generated_BatchService_GetTask_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -638,33 +638,33 @@ "regionTag": "batch_v1_generated_BatchService_GetTask_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -719,33 +719,33 @@ "regionTag": "batch_v1_generated_BatchService_ListJobs_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 40, - "start": 38, + "end": 47, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 41, + "end": 52, + "start": 48, "type": "RESPONSE_HANDLING" } ], @@ -799,33 +799,33 @@ "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 40, - "start": 38, + "end": 47, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 41, + "end": 52, + "start": 48, "type": "RESPONSE_HANDLING" } ], @@ -880,33 +880,33 @@ "regionTag": "batch_v1_generated_BatchService_ListTasks_async", "segments": [ { - "end": 45, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 52, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 42, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -960,33 +960,33 @@ "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", "segments": [ { - "end": 45, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 52, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 42, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 329b3e37f0d2..45ce95accaa0 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -67,33 +67,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -155,33 +155,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -236,33 +236,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", "segments": [ { - "end": 47, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 47, + "end": 54, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 44, - "start": 38, + "end": 51, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 48, - "start": 45, + "end": 55, + "start": 52, "type": "RESPONSE_HANDLING" } ], @@ -316,33 +316,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", "segments": [ { - "end": 47, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 47, + "end": 54, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 44, - "start": 38, + "end": 51, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 48, - "start": 45, + "end": 55, + "start": 52, "type": "RESPONSE_HANDLING" } ], @@ -397,33 +397,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -477,33 +477,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -558,33 +558,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -638,33 +638,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -719,33 +719,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 40, - "start": 38, + "end": 47, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 41, + "end": 52, + "start": 48, "type": "RESPONSE_HANDLING" } ], @@ -799,33 +799,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", "segments": [ { - "end": 44, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 51, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 37, - "start": 34, + "end": 44, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 40, - "start": 38, + "end": 47, + "start": 45, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 41, + "end": 52, + "start": 48, "type": "RESPONSE_HANDLING" } ], @@ -880,33 +880,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", "segments": [ { - "end": 45, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 52, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 42, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], @@ -960,33 +960,33 @@ "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", "segments": [ { - "end": 45, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 52, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 40, + "start": 38, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 45, + "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 42, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], From 2e416592ee83f6b495acd22ff4b9ffb2c4d023e6 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Thu, 15 Sep 2022 15:43:13 +0200 Subject: [PATCH 04/31] docs(samples): Adding first sample code + tests (#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): Adding basic code samples + tests * Checking something * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Fixing noxfile * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Fixing noxfile with new test detection * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Trying to understand what's wrong * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * use latest post processor image * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Fixing the requirements * Making tests more resilent * Improving tests * Tests no longer use logging * Another fix... * Fixing lint problems * Fixing tests Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- compute/batch/__init__.py | 13 + compute/batch/noxfile.py | 313 ++++++++++++++++++ compute/batch/noxfile_config.py | 17 + compute/batch/requirements-test.txt | 2 + compute/batch/requirements.txt | 3 + compute/batch/snippets/__init__.py | 0 compute/batch/snippets/create/__init__.py | 0 .../create_with_container_no_mounting.py | 86 +++++ .../create/create_with_script_no_mounting.py | 86 +++++ compute/batch/snippets/delete/delete_job.py | 37 +++ compute/batch/snippets/get/get_job.py | 35 ++ compute/batch/snippets/list/list_jobs.py | 34 ++ compute/batch/snippets/tests/__init__.py | 0 compute/batch/snippets/tests/test_basics.py | 79 +++++ 14 files changed, 705 insertions(+) create mode 100644 compute/batch/__init__.py create mode 100644 compute/batch/noxfile.py create mode 100644 compute/batch/noxfile_config.py create mode 100644 compute/batch/requirements-test.txt create mode 100644 compute/batch/requirements.txt create mode 100644 compute/batch/snippets/__init__.py create mode 100644 compute/batch/snippets/create/__init__.py create mode 100644 compute/batch/snippets/create/create_with_container_no_mounting.py create mode 100644 compute/batch/snippets/create/create_with_script_no_mounting.py create mode 100644 compute/batch/snippets/delete/delete_job.py create mode 100644 compute/batch/snippets/get/get_job.py create mode 100644 compute/batch/snippets/list/list_jobs.py create mode 100644 compute/batch/snippets/tests/__init__.py create mode 100644 compute/batch/snippets/tests/test_basics.py diff --git a/compute/batch/__init__.py b/compute/batch/__init__.py new file mode 100644 index 000000000000..4bbe0ffdb061 --- /dev/null +++ b/compute/batch/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/compute/batch/noxfile.py b/compute/batch/noxfile.py new file mode 100644 index 000000000000..b053ca568f63 --- /dev/null +++ b/compute/batch/noxfile.py @@ -0,0 +1,313 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import print_function + +import glob +import os +from pathlib import Path +import sys +from typing import Callable, Dict, List, Optional + +import nox + + +# WARNING - WARNING - WARNING - WARNING - WARNING +# WARNING - WARNING - WARNING - WARNING - WARNING +# DO NOT EDIT THIS FILE EVER! +# WARNING - WARNING - WARNING - WARNING - WARNING +# WARNING - WARNING - WARNING - WARNING - WARNING + +BLACK_VERSION = "black==22.3.0" +ISORT_VERSION = "isort==5.10.1" + +# Copy `noxfile_config.py` to your directory and modify it instead. + +# `TEST_CONFIG` dict is a configuration hook that allows users to +# modify the test configurations. The values here should be in sync +# with `noxfile_config.py`. Users will copy `noxfile_config.py` into +# their directory and modify it. + +TEST_CONFIG = { + # You can opt out from the test for specific Python versions. + "ignored_versions": [], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "enforce_type_hints": False, + # An envvar key for determining the project id to use. Change it + # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # If you need to use a specific version of pip, + # change pip_version_override to the string representation + # of the version number, for example, "20.2.4" + "pip_version_override": None, + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": {}, +} + + +try: + # Ensure we can import noxfile_config in the project's directory. + sys.path.append(".") + from noxfile_config import TEST_CONFIG_OVERRIDE +except ImportError as e: + print("No user noxfile_config found: detail: {}".format(e)) + TEST_CONFIG_OVERRIDE = {} + +# Update the TEST_CONFIG with the user supplied values. +TEST_CONFIG.update(TEST_CONFIG_OVERRIDE) + + +def get_pytest_env_vars() -> Dict[str, str]: + """Returns a dict for pytest invocation.""" + ret = {} + + # Override the GCLOUD_PROJECT and the alias. + env_key = TEST_CONFIG["gcloud_project_env"] + # This should error out if not set. + ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] + + # Apply user supplied envs. + ret.update(TEST_CONFIG["envs"]) + return ret + + +# DO NOT EDIT - automatically generated. +# All versions used to test samples. +ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] + +# Any default versions that should be ignored. +IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] + +TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) + +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) + +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True + +# +# Style Checks +# + + +def _determine_local_import_names(start_dir: str) -> List[str]: + """Determines all import names that should be considered "local". + + This is used when running the linter to insure that import order is + properly checked. + """ + file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)] + return [ + basename + for basename, extension in file_ext_pairs + if extension == ".py" + or os.path.isdir(os.path.join(start_dir, basename)) + and basename not in ("__pycache__") + ] + + +# Linting with flake8. +# +# We ignore the following rules: +# E203: whitespace before ‘:’ +# E266: too many leading ‘#’ for block comment +# E501: line too long +# I202: Additional newline in a section of imports +# +# We also need to specify the rules which are ignored by default: +# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] +FLAKE8_COMMON_ARGS = [ + "--show-source", + "--builtin=gettext", + "--max-complexity=20", + "--import-order-style=google", + "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", + "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", + "--max-line-length=88", +] + + +@nox.session +def lint(session: nox.sessions.Session) -> None: + if not TEST_CONFIG["enforce_type_hints"]: + session.install("flake8", "flake8-import-order") + else: + session.install("flake8", "flake8-import-order", "flake8-annotations") + + local_names = _determine_local_import_names(".") + args = FLAKE8_COMMON_ARGS + [ + "--application-import-names", + ",".join(local_names), + ".", + ] + session.run("flake8", *args) + + +# +# Black +# + + +@nox.session +def blacken(session: nox.sessions.Session) -> None: + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + python_files = [path for path in os.listdir(".") if path.endswith(".py")] + + session.run("black", *python_files) + + +# +# format = isort + black +# + + +@nox.session +def format(session: nox.sessions.Session) -> None: + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + python_files = [path for path in os.listdir(".") if path.endswith(".py")] + + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run("isort", "--fss", *python_files) + session.run("black", *python_files) + + +# +# Sample Tests +# + + +PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] + + +def _session_tests( + session: nox.sessions.Session, post_install: Callable = None +) -> None: + # check for presence of tests + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( + "**/test_*.py", recursive=True + ) + test_list.extend(glob.glob("**/tests", recursive=True)) + + if len(test_list) == 0: + print("No tests found, skipping directory.") + return + + if TEST_CONFIG["pip_version_override"]: + pip_version = TEST_CONFIG["pip_version_override"] + session.install(f"pip=={pip_version}") + """Runs py.test for a particular project.""" + concurrent_args = [] + if os.path.exists("requirements.txt"): + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") + with open("requirements.txt") as rfile: + packages = rfile.read() + + if os.path.exists("requirements-test.txt"): + if os.path.exists("constraints-test.txt"): + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") + else: + session.install("-r", "requirements-test.txt") + with open("requirements-test.txt") as rtfile: + packages += rtfile.read() + + if INSTALL_LIBRARY_FROM_SOURCE: + session.install("-e", _get_repo_root()) + + if post_install: + post_install(session) + + if "pytest-parallel" in packages: + concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) + elif "pytest-xdist" in packages: + concurrent_args.extend(["-n", "auto"]) + + session.run( + "pytest", + *(PYTEST_COMMON_ARGS + session.posargs + concurrent_args), + # Pytest will return 5 when no tests are collected. This can happen + # on travis where slow and flaky tests are excluded. + # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html + success_codes=[0, 5], + env=get_pytest_env_vars(), + ) + + +@nox.session(python=ALL_VERSIONS) +def py(session: nox.sessions.Session) -> None: + """Runs py.test for a sample using the specified version of Python.""" + if session.python in TESTED_VERSIONS: + _session_tests(session) + else: + session.skip( + "SKIPPED: {} tests are disabled for this sample.".format(session.python) + ) + + +# +# Readmegen +# + + +def _get_repo_root() -> Optional[str]: + """Returns the root folder of the project.""" + # Get root of this repository. Assume we don't have directories nested deeper than 10 items. + p = Path(os.getcwd()) + for i in range(10): + if p is None: + break + if Path(p / ".git").exists(): + return str(p) + # .git is not available in repos cloned via Cloud Build + # setup.py is always in the library's root, so use that instead + # https://github.com/googleapis/synthtool/issues/792 + if Path(p / "setup.py").exists(): + return str(p) + p = p.parent + raise Exception("Unable to detect repository root.") + + +GENERATED_READMES = sorted([x for x in Path(".").rglob("*.rst.in")]) + + +@nox.session +@nox.parametrize("path", GENERATED_READMES) +def readmegen(session: nox.sessions.Session, path: str) -> None: + """(Re-)generates the readme for a sample.""" + session.install("jinja2", "pyyaml") + dir_ = os.path.dirname(path) + + if os.path.exists(os.path.join(dir_, "requirements.txt")): + session.install("-r", os.path.join(dir_, "requirements.txt")) + + in_file = os.path.join(dir_, "README.rst.in") + session.run( + "python", _get_repo_root() + "/scripts/readme-gen/readme_gen.py", in_file + ) diff --git a/compute/batch/noxfile_config.py b/compute/batch/noxfile_config.py new file mode 100644 index 000000000000..d27b90b5086b --- /dev/null +++ b/compute/batch/noxfile_config.py @@ -0,0 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TEST_CONFIG_OVERRIDE = { + "gcloud_project_env": "BUILD_SPECIFIC_GCLOUD_PROJECT", +} diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt new file mode 100644 index 000000000000..698bc68df1fb --- /dev/null +++ b/compute/batch/requirements-test.txt @@ -0,0 +1,2 @@ +pytest==7.1.2 +pytest-parallel==0.1.1 diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt new file mode 100644 index 000000000000..84827e746394 --- /dev/null +++ b/compute/batch/requirements.txt @@ -0,0 +1,3 @@ +isort==5.10.1 +black==22.6.0 +google-cloud-batch==0.1.2 diff --git a/compute/batch/snippets/__init__.py b/compute/batch/snippets/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/compute/batch/snippets/create/__init__.py b/compute/batch/snippets/create/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/compute/batch/snippets/create/create_with_container_no_mounting.py b/compute/batch/snippets/create/create_with_container_no_mounting.py new file mode 100644 index 000000000000..9c54318f2a57 --- /dev/null +++ b/compute/batch/snippets/create/create_with_container_no_mounting.py @@ -0,0 +1,86 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_create_container_job] +from google.cloud import batch_v1 + + +def create_container_job(project_id: str, region: str, job_name: str) -> batch_v1.Job: + """ + This method shows how to create a sample Batch Job that will run + a simple command inside a container on Cloud Compute instances. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region you want to use to run the job. Regions that are + available for Batch are listed on: https://cloud.google.com/batch/docs/get-started#locations + job_name: the name of the job that will be created. + It needs to be unique for each project and region pair. + + Returns: + A job object representing the job created. + """ + client = batch_v1.BatchServiceClient() + + # Define what will be done as part of the job. + runnable = batch_v1.Runnable() + runnable.container = batch_v1.Runnable.Container() + runnable.container.image_uri = "gcr.io/google-containers/busybox" + runnable.container.entrypoint = "/bin/sh" + runnable.container.commands = ["-c", "echo Hello world! This is task ${BATCH_TASK_INDEX}. This job has a total of ${BATCH_TASK_COUNT} tasks."] + + # Jobs can be divided into tasks. In this case, we have only one task. + task = batch_v1.TaskSpec() + task.runnables = [runnable] + + # We can specify what resources are requested by each task. + resources = batch_v1.ComputeResource() + resources.cpu_milli = 2000 # in milliseconds per cpu-second. This means the task requires 2 whole CPUs. + resources.memory_mib = 16 # in MiB + task.compute_resource = resources + + task.max_retry_count = 2 + task.max_run_duration = "3600s" + + # Tasks are grouped inside a job using TaskGroups. + group = batch_v1.TaskGroup() + group.task_count = 4 + group.task_spec = task + + # Policies are used to define on what kind of virtual machines the tasks will run on. + # In this case, we tell the system to use "e2-standard-4" machine type. + # Read more about machine types here: https://cloud.google.com/compute/docs/machine-types + policy = batch_v1.AllocationPolicy.InstancePolicy() + policy.machine_type = "e2-standard-4" + instances = batch_v1.AllocationPolicy.InstancePolicyOrTemplate() + instances.policy = policy + allocation_policy = batch_v1.AllocationPolicy() + allocation_policy.instances = [instances] + + job = batch_v1.Job() + job.task_groups = [group] + job.allocation_policy = allocation_policy + job.labels = {"env": "testing", "type": "container"} + # We use Cloud Logging as it's an out of the box available option + job.logs_policy = batch_v1.LogsPolicy() + job.logs_policy.destination = batch_v1.LogsPolicy.Destination.CLOUD_LOGGING + + create_request = batch_v1.CreateJobRequest() + create_request.job = job + create_request.job_id = job_name + # The job's parent is the region in which the job will run + create_request.parent = f"projects/{project_id}/locations/{region}" + + return client.create_job(create_request) +# [END batch_create_container_job] diff --git a/compute/batch/snippets/create/create_with_script_no_mounting.py b/compute/batch/snippets/create/create_with_script_no_mounting.py new file mode 100644 index 000000000000..29942cb4d50d --- /dev/null +++ b/compute/batch/snippets/create/create_with_script_no_mounting.py @@ -0,0 +1,86 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_create_script_job] +from google.cloud import batch_v1 + + +def create_script_job(project_id: str, region: str, job_name: str) -> batch_v1.Job: + """ + This method shows how to create a sample Batch Job that will run + a simple command on Cloud Compute instances. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region you want to use to run the job. Regions that are + available for Batch are listed on: https://cloud.google.com/batch/docs/get-started#locations + job_name: the name of the job that will be created. + It needs to be unique for each project and region pair. + + Returns: + A job object representing the job created. + """ + client = batch_v1.BatchServiceClient() + + # Define what will be done as part of the job. + task = batch_v1.TaskSpec() + runnable = batch_v1.Runnable() + runnable.script = batch_v1.Runnable.Script() + runnable.script.text = "echo Hello world! This is task ${BATCH_TASK_INDEX}. This job has a total of ${BATCH_TASK_COUNT} tasks." + # You can also run a script from a file. Just remember, that needs to be a script that's + # already on the VM that will be running the job. Using runnable.script.text and runnable.script.path is mutually + # exclusive. + # runnable.script.path = '/tmp/test.sh' + task.runnables = [runnable] + + # We can specify what resources are requested by each task. + resources = batch_v1.ComputeResource() + resources.cpu_milli = 2000 # in milliseconds per cpu-second. This means the task requires 2 whole CPUs. + resources.memory_mib = 16 + task.compute_resource = resources + + task.max_retry_count = 2 + task.max_run_duration = "3600s" + + # Tasks are grouped inside a job using TaskGroups. + group = batch_v1.TaskGroup() + group.task_count = 4 + group.task_spec = task + + # Policies are used to define on what kind of virtual machines the tasks will run on. + # In this case, we tell the system to use "e2-standard-4" machine type. + # Read more about machine types here: https://cloud.google.com/compute/docs/machine-types + allocation_policy = batch_v1.AllocationPolicy() + policy = batch_v1.AllocationPolicy.InstancePolicy() + policy.machine_type = "e2-standard-4" + instances = batch_v1.AllocationPolicy.InstancePolicyOrTemplate() + instances.policy = policy + allocation_policy.instances = [instances] + + job = batch_v1.Job() + job.task_groups = [group] + job.allocation_policy = allocation_policy + job.labels = {"env": "testing", "type": "script"} + # We use Cloud Logging as it's an out of the box available option + job.logs_policy = batch_v1.LogsPolicy() + job.logs_policy.destination = batch_v1.LogsPolicy.Destination.CLOUD_LOGGING + + create_request = batch_v1.CreateJobRequest() + create_request.job = job + create_request.job_id = job_name + # The job's parent is the region in which the job will run + create_request.parent = f"projects/{project_id}/locations/{region}" + + return client.create_job(create_request) +# [END batch_create_script_job] diff --git a/compute/batch/snippets/delete/delete_job.py b/compute/batch/snippets/delete/delete_job.py new file mode 100644 index 000000000000..f4ebdcdea0ab --- /dev/null +++ b/compute/batch/snippets/delete/delete_job.py @@ -0,0 +1,37 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_delete_job] +from google.api_core.operation import Operation + +from google.cloud import batch_v1 + + +def delete_job(project_id: str, region: str, job_name: str) -> Operation: + """ + Triggers the deletion of a Job. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region hosts the job. + job_name: the name of the job that you want to delete. + + Returns: + An operation object related to the deletion. You can call `.result()` + on it to wait for its completion. + """ + client = batch_v1.BatchServiceClient() + + return client.delete_job(name=f"projects/{project_id}/locations/{region}/jobs/{job_name}") +# [END batch_delete_job] diff --git a/compute/batch/snippets/get/get_job.py b/compute/batch/snippets/get/get_job.py new file mode 100644 index 000000000000..8dff7376ecf7 --- /dev/null +++ b/compute/batch/snippets/get/get_job.py @@ -0,0 +1,35 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_get_job] + +from google.cloud import batch_v1 + + +def get_job(project_id: str, region: str, job_name: str) -> batch_v1.Job: + """ + Retrieve information about a Batch Job. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region hosts the job. + job_name: the name of the job you want to retrieve information about. + + Returns: + A Job object representing the specified job. + """ + client = batch_v1.BatchServiceClient() + + return client.get_job(name=f"projects/{project_id}/locations/{region}/jobs/{job_name}") +# [END batch_get_job] diff --git a/compute/batch/snippets/list/list_jobs.py b/compute/batch/snippets/list/list_jobs.py new file mode 100644 index 000000000000..77c39b5ce0cf --- /dev/null +++ b/compute/batch/snippets/list/list_jobs.py @@ -0,0 +1,34 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from typing import Iterable + +# [START batch_list_jobs] +from google.cloud import batch_v1 + + +def list_jobs(project_id: str, region: str) -> Iterable[batch_v1.Job]: + """ + Get a list of all jobs defined in given region. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region hosting the jobs. + + Returns: + An iterable collection of Job object. + """ + client = batch_v1.BatchServiceClient() + + return client.list_jobs(parent=f"projects/{project_id}/locations/{region}") +# [END batch_list_jobs] diff --git a/compute/batch/snippets/tests/__init__.py b/compute/batch/snippets/tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/compute/batch/snippets/tests/test_basics.py b/compute/batch/snippets/tests/test_basics.py new file mode 100644 index 000000000000..88dfa75c0ef8 --- /dev/null +++ b/compute/batch/snippets/tests/test_basics.py @@ -0,0 +1,79 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import time +import uuid + + +import google.auth +from google.cloud import batch_v1 +import pytest + +from ..create.create_with_container_no_mounting import create_container_job +from ..create.create_with_script_no_mounting import create_script_job + +from ..delete.delete_job import delete_job +from ..get.get_job import get_job +from ..list.list_jobs import list_jobs + +PROJECT = google.auth.default()[1] +REGION = 'europe-north1' + +TIMEOUT = 600 # 10 minutes + +WAIT_STATES = { + batch_v1.JobStatus.State.STATE_UNSPECIFIED, + batch_v1.JobStatus.State.QUEUED, + batch_v1.JobStatus.State.RUNNING, + batch_v1.JobStatus.State.SCHEDULED, +} + + +@pytest.fixture +def job_name(): + return f"test-job-{uuid.uuid4().hex[:10]}" + + +def _test_body(test_job: batch_v1.Job): + start_time = time.time() + try: + while test_job.status.state in WAIT_STATES: + if time.time() - start_time > TIMEOUT: + pytest.fail("Timed out while waiting for job to complete!") + test_job = get_job(PROJECT, REGION, test_job.name.rsplit('/', maxsplit=1)[1]) + time.sleep(5) + + assert test_job.status.state in (batch_v1.JobStatus.State.SUCCEEDED, + batch_v1.JobStatus.State.DELETION_IN_PROGRESS) + + for job in list_jobs(PROJECT, REGION): + if test_job.uid == job.uid: + break + else: + pytest.fail(f"Couldn't find job {test_job.uid} on the list of jobs.") + finally: + delete_job(PROJECT, REGION, test_job.name.rsplit('/', maxsplit=1)[1]).result() + + for job in list_jobs(PROJECT, REGION): + if job.uid == test_job.uid: + pytest.fail("The test job should be deleted at this point!") + + +def test_script_job(job_name): + job = create_script_job(PROJECT, REGION, job_name) + _test_body(job) + + +def test_container_job(job_name): + job = create_container_job(PROJECT, REGION, job_name) + _test_body(job) From 8bdfeeef96a376dbc80fa7b28d5c6387f25f753a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:22:16 +0000 Subject: [PATCH 05/31] feat: Add support for REST transport (#37) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474571730 Source-Link: https://github.com/googleapis/googleapis/commit/5a9ee4d5deca8e3da550b0419ed336e22521fc8e Source-Link: https://github.com/googleapis/googleapis-gen/commit/ceafe521f137680fdee2f9ca9e1947cdd825070d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2VhZmU1MjFmMTM3NjgwZmRlZTJmOWNhOWUxOTQ3Y2RkODI1MDcwZCJ9 fix(deps): require google-api-core>=1.33.1,>=2.8.0 fix(deps): require protobuf >= 3.20.1 --- ..._batch_service_create_job_sync_2bc66fef.py | 52 ++ ..._batch_service_create_job_sync_6f38dd76.py | 52 ++ ..._batch_service_delete_job_sync_0196009c.py | 55 ++ ..._batch_service_delete_job_sync_91684552.py | 55 ++ ...ted_batch_service_get_job_sync_97ad7e29.py | 52 ++ ...ted_batch_service_get_job_sync_b06cc31b.py | 52 ++ ...ed_batch_service_get_task_sync_bbff024f.py | 52 ++ ...ed_batch_service_get_task_sync_fa6ae8a7.py | 52 ++ ...d_batch_service_list_jobs_sync_2430eb9c.py | 52 ++ ...d_batch_service_list_jobs_sync_d2310594.py | 52 ++ ..._batch_service_list_tasks_sync_9b3f04d1.py | 53 ++ ..._batch_service_list_tasks_sync_adf409cc.py | 53 ++ ..._batch_service_create_job_sync_eb4fa717.py | 52 ++ ..._batch_service_create_job_sync_ee80cfe8.py | 52 ++ ..._batch_service_delete_job_sync_18fb9154.py | 55 ++ ..._batch_service_delete_job_sync_affefd11.py | 55 ++ ...ted_batch_service_get_job_sync_1014e8c7.py | 52 ++ ...ted_batch_service_get_job_sync_17387e0a.py | 52 ++ ...ed_batch_service_get_task_sync_29b69ea9.py | 52 ++ ...ed_batch_service_get_task_sync_657a0e4c.py | 52 ++ ...d_batch_service_list_jobs_sync_21301b63.py | 52 ++ ...d_batch_service_list_jobs_sync_830dac29.py | 52 ++ ..._batch_service_list_tasks_sync_97ddc579.py | 53 ++ ..._batch_service_list_tasks_sync_af95f032.py | 53 ++ .../snippet_metadata_batch_v1.json | 512 +++++++++++++++++- .../snippet_metadata_batch_v1alpha.json | 512 +++++++++++++++++- 26 files changed, 2264 insertions(+), 24 deletions(-) create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py create mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py create mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py new file mode 100644 index 000000000000..e3ae8a75ea92 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_CreateJob_sync_2bc66fef] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_create_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_CreateJob_sync_2bc66fef] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py new file mode 100644 index 000000000000..d746f6c0d058 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_CreateJob_sync_6f38dd76] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_create_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_CreateJob_sync_6f38dd76] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py new file mode 100644 index 000000000000..b00884b96287 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_DeleteJob_sync_0196009c] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_delete_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_DeleteJob_sync_0196009c] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py new file mode 100644 index 000000000000..664bb1f9f294 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_DeleteJob_sync_91684552] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_delete_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_DeleteJob_sync_91684552] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py new file mode 100644 index 000000000000..7f399fbd464c --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetJob_sync_97ad7e29] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_get_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.GetJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetJob_sync_97ad7e29] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py new file mode 100644 index 000000000000..b4d2f940facd --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetJob_sync_b06cc31b] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_get_job(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.GetJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetJob_sync_b06cc31b] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py new file mode 100644 index 000000000000..9fd310362f0a --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetTask_sync_bbff024f] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_get_task(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetTask_sync_bbff024f] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py new file mode 100644 index 000000000000..74f5d0958257 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_GetTask_sync_fa6ae8a7] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_get_task(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1_generated_BatchService_GetTask_sync_fa6ae8a7] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py new file mode 100644 index 000000000000..4c5643c92dfb --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListJobs_sync_2430eb9c] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_list_jobs(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListJobs_sync_2430eb9c] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py new file mode 100644 index 000000000000..5fffe7707541 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListJobs_sync_d2310594] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_list_jobs(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListJobs_sync_d2310594] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py new file mode 100644 index 000000000000..b8b50f246e51 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListTasks_sync_9b3f04d1] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_list_tasks(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListTasks_sync_9b3f04d1] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py new file mode 100644 index 000000000000..3e5bad8a4d8f --- /dev/null +++ b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1_generated_BatchService_ListTasks_sync_adf409cc] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1 + + +def sample_list_tasks(): + # Create a client + client = batch_v1.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1_generated_BatchService_ListTasks_sync_adf409cc] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py new file mode 100644 index 000000000000..90801c06d175 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_CreateJob_sync_eb4fa717] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_create_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_CreateJob_sync_eb4fa717] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py new file mode 100644 index 000000000000..1c6700aaea68 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_CreateJob_sync_ee80cfe8] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_create_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.CreateJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_CreateJob_sync_ee80cfe8] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py new file mode 100644 index 000000000000..52fb6a7d1d73 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_DeleteJob_sync_18fb9154] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_delete_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_DeleteJob_sync_18fb9154] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py new file mode 100644 index 000000000000..0b33e6713319 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_DeleteJob_sync_affefd11] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_delete_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.DeleteJobRequest( + ) + + # Make the request + operation = client.delete_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_DeleteJob_sync_affefd11] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py new file mode 100644 index 000000000000..0a6aa64e15a8 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetJob_sync_1014e8c7] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_get_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetJob_sync_1014e8c7] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py new file mode 100644 index 000000000000..0eb32471fcfd --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetJob_sync_17387e0a] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_get_job(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_job(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetJob_sync_17387e0a] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py new file mode 100644 index 000000000000..a96957843c37 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetTask_sync_29b69ea9] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_get_task(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetTask_sync_29b69ea9] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py new file mode 100644 index 000000000000..2404c5200e7d --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_GetTask_sync_657a0e4c] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_get_task(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END batch_v1alpha_generated_BatchService_GetTask_sync_657a0e4c] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py new file mode 100644 index 000000000000..799f23360448 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListJobs_sync_21301b63] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_list_jobs(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListJobs_sync_21301b63] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py new file mode 100644 index 000000000000..03cb615a3380 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListJobs_sync_830dac29] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_list_jobs(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListJobsRequest( + ) + + # Make the request + page_result = client.list_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListJobs_sync_830dac29] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py new file mode 100644 index 000000000000..8c0ac9efc690 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListTasks_sync_97ddc579] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_list_tasks(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListTasks_sync_97ddc579] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py new file mode 100644 index 000000000000..c584fda06f95 --- /dev/null +++ b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-batch + + +# [START batch_v1alpha_generated_BatchService_ListTasks_sync_af95f032] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import batch_v1alpha + + +def sample_list_tasks(): + # Create a client + client = batch_v1alpha.BatchServiceClient() + + # Initialize request argument(s) + request = batch_v1alpha.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END batch_v1alpha_generated_BatchService_ListTasks_sync_af95f032] diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json index bc11c0d177e3..9a7609f6e058 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync.py", + "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -185,7 +185,95 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync.py" + "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.create_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "CreateJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.batch_v1.types.Job" + }, + { + "name": "job_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Job", + "shortName": "create_job" + }, + "description": "Sample for CreateJob", + "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" }, { "canonical": true, @@ -310,7 +398,87 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.delete_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "DeleteJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_job" + }, + "description": "Sample for DeleteJob", + "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -346,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" }, { "canonical": true, @@ -471,7 +639,87 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync.py", + "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_GetJob_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.get_job", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Job", + "shortName": "get_job" + }, + "description": "Sample for GetJob", + "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -507,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync.py" + "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" }, { "canonical": true, @@ -632,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync.py", + "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -668,7 +916,87 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync.py" + "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.get_task", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetTask" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.types.Task", + "shortName": "get_task" + }, + "description": "Sample for GetTask", + "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_GetTask_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" }, { "canonical": true, @@ -793,7 +1121,87 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.list_jobs", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListJobs" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListJobsPager", + "shortName": "list_jobs" + }, + "description": "Sample for ListJobs", + "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -829,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" }, { "canonical": true, @@ -954,7 +1362,87 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1.BatchServiceClient.list_tasks", + "method": { + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "service": { + "fullName": "google.cloud.batch.v1.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListTasks" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListTasksPager", + "shortName": "list_tasks" + }, + "description": "Sample for ListTasks", + "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -990,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" } ] } diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 45ce95accaa0..5a49807d0497 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -185,7 +185,95 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.create_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "CreateJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.CreateJobRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "job", + "type": "google.cloud.batch_v1alpha.types.Job" + }, + { + "name": "job_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Job", + "shortName": "create_job" + }, + "description": "Sample for CreateJob", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" }, { "canonical": true, @@ -310,7 +398,87 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.delete_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "DeleteJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.DeleteJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_job" + }, + "description": "Sample for DeleteJob", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -346,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" }, { "canonical": true, @@ -471,7 +639,87 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_job", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetJob" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.GetJobRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Job", + "shortName": "get_job" + }, + "description": "Sample for GetJob", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -507,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" }, { "canonical": true, @@ -632,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -668,7 +916,87 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_task", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "GetTask" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.types.Task", + "shortName": "get_task" + }, + "description": "Sample for GetTask", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" }, { "canonical": true, @@ -793,7 +1121,87 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_jobs", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListJobs" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.ListJobsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListJobsPager", + "shortName": "list_jobs" + }, + "description": "Sample for ListJobs", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -829,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" }, { "canonical": true, @@ -954,7 +1362,87 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", + "shortName": "BatchServiceClient" + }, + "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_tasks", + "method": { + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "service": { + "fullName": "google.cloud.batch.v1alpha.BatchService", + "shortName": "BatchService" + }, + "shortName": "ListTasks" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.batch_v1alpha.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListTasksPager", + "shortName": "list_tasks" + }, + "description": "Sample for ListTasks", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -990,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" } ] } From 44c06647bb7feac3de933d82f062b5a81254f3fe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 16 Sep 2022 17:55:37 +0200 Subject: [PATCH 06/31] chore(deps): update all dependencies (#36) Co-authored-by: Anthonios Partheniou --- compute/batch/requirements-test.txt | 2 +- compute/batch/requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index 698bc68df1fb..75ceb43cfe42 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==7.1.2 +pytest==7.1.3 pytest-parallel==0.1.1 diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index 84827e746394..e88c9b010664 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,3 @@ isort==5.10.1 -black==22.6.0 -google-cloud-batch==0.1.2 +black==22.8.0 +google-cloud-batch==0.2.0 From 612ebbfb3d4db14cd15c7793a46195308fe545dc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 21:02:06 -0400 Subject: [PATCH 07/31] chore: regenerate samples (#39) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update gapic-generator-python to 1.4.3 with test fixes PiperOrigin-RevId: 475399737 Source-Link: https://github.com/googleapis/googleapis/commit/4c4a9a261e29cbd6123e26bd701449a6dad2e695 Source-Link: https://github.com/googleapis/googleapis-gen/commit/72fdb5ae55a4d6583893a3e57b7ef264850d06cd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzJmZGI1YWU1NWE0ZDY1ODM4OTNhM2U1N2I3ZWYyNjQ4NTBkMDZjZCJ9 * 🦉 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 --- .../snippet_metadata_batch_v1alpha.json | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 5a49807d0497..79666153d05a 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" } ] } From cee794e79aa06e75954169970f8f262cb4a5363b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 13:21:12 +0200 Subject: [PATCH 08/31] chore(deps): update dependency google-cloud-batch to v0.3.0 (#38) Co-authored-by: Anthonios Partheniou --- compute/batch/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index e88c9b010664..0deda5cd796d 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,3 @@ isort==5.10.1 black==22.8.0 -google-cloud-batch==0.2.0 +google-cloud-batch==0.3.0 From cf455021ff71d2c9a50601cde0fe1ad9a73a1fe1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 09:46:23 -0400 Subject: [PATCH 09/31] chore: regenerate samples (#40) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PiperOrigin-RevId: 475580307 Source-Link: https://github.com/googleapis/googleapis/commit/dbc83bd75946f2dbbca5fbb2be13d6afbc635b83 Source-Link: https://github.com/googleapis/googleapis-gen/commit/26c120594d6049d40061023cae345da80181077c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjZjMTIwNTk0ZDYwNDlkNDAwNjEwMjNjYWUzNDVkYTgwMTgxMDc3YyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add support for V1 and V2 classification models for the V1Beta2 API PiperOrigin-RevId: 475604619 Source-Link: https://github.com/googleapis/googleapis/commit/044a15c14b1a1939684ad271c13ac84c5ac6a2c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/410020af934c7248f7804770d6f8ec4571bfa551 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDEwMDIwYWY5MzRjNzI0OGY3ODA0NzcwZDZmOGVjNDU3MWJmYTU1MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: update gapic-generator-python-1.4.4 with unit tests generation fixes PiperOrigin-RevId: 475683078 Source-Link: https://github.com/googleapis/googleapis/commit/df791ce27f14506140007b62244bc326a5465f23 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ee0ce41cb9bf7bb51005e991022b00ce1bc669d8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWUwY2U0MWNiOWJmN2JiNTEwMDVlOTkxMDIyYjAwY2UxYmM2NjlkOCJ9 * 🦉 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 --- .../snippet_metadata_batch_v1alpha.json | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 79666153d05a..5a49807d0497 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" } ] } From 5a1b6b37c99d56e9c7cbfb55ca8be401a8c28e0a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:33:45 -0400 Subject: [PATCH 10/31] chore: regenerate samples (#42) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: release SensitiveAction Cloud Logging payload to v1 PiperOrigin-RevId: 476083958 Source-Link: https://github.com/googleapis/googleapis/commit/fafd03f8da224663da0d83ee7c6ed1d84f3cb2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/79c1b9ce243374735651e72cdebcbed99f5e4e65 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzljMWI5Y2UyNDMzNzQ3MzU2NTFlNzJjZGViY2JlZDk5ZjVlNGU2NSJ9 * 🦉 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 --- .../snippet_metadata_batch_v1alpha.json | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 5a49807d0497..79666153d05a 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" } ] } From c4f3b6930cc7e5d1c193e9a1bb880617dff537e8 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Tue, 27 Sep 2022 16:33:54 +0200 Subject: [PATCH 11/31] docs(samples): Adding sample for bucket mounting (#43) * docs(samples): Adding sample for bucket mounting * Fixing lint stuff. --- compute/batch/requirements-test.txt | 1 + .../create/create_with_mounted_bucket.py | 90 +++++++++++++++++++ compute/batch/snippets/tests/test_basics.py | 7 +- compute/batch/snippets/tests/test_bucket.py | 70 +++++++++++++++ 4 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 compute/batch/snippets/create/create_with_mounted_bucket.py create mode 100644 compute/batch/snippets/tests/test_bucket.py diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index 75ceb43cfe42..a30f83328b79 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,2 +1,3 @@ pytest==7.1.3 pytest-parallel==0.1.1 +google-cloud-storage==2.5.0 diff --git a/compute/batch/snippets/create/create_with_mounted_bucket.py b/compute/batch/snippets/create/create_with_mounted_bucket.py new file mode 100644 index 000000000000..469df9c8994c --- /dev/null +++ b/compute/batch/snippets/create/create_with_mounted_bucket.py @@ -0,0 +1,90 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_create_script_job_with_bucket] +from google.cloud import batch_v1 + + +def create_script_job_with_bucket(project_id: str, region: str, job_name: str, bucket_name: str) -> batch_v1.Job: + """ + This method shows how to create a sample Batch Job that will run + a simple command on Cloud Compute instances. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region you want to use to run the job. Regions that are + available for Batch are listed on: https://cloud.google.com/batch/docs/get-started#locations + job_name: the name of the job that will be created. + It needs to be unique for each project and region pair. + bucket_name: name of the bucket to be mounted for your Job. + + Returns: + A job object representing the job created. + """ + client = batch_v1.BatchServiceClient() + + # Define what will be done as part of the job. + task = batch_v1.TaskSpec() + runnable = batch_v1.Runnable() + runnable.script = batch_v1.Runnable.Script() + runnable.script.text = "echo Hello world from task ${BATCH_TASK_INDEX}. >> /mnt/share/output_task_${BATCH_TASK_INDEX}.txt" + task.runnables = [runnable] + + gcs_bucket = batch_v1.GCS() + gcs_bucket.remote_path = bucket_name + gcs_volume = batch_v1.Volume() + gcs_volume.gcs = gcs_bucket + gcs_volume.mount_path = '/mnt/share' + task.volumes = [gcs_volume] + + # We can specify what resources are requested by each task. + resources = batch_v1.ComputeResource() + resources.cpu_milli = 500 # in milliseconds per cpu-second. This means the task requires 50% of a single CPUs. + resources.memory_mib = 16 + task.compute_resource = resources + + task.max_retry_count = 2 + task.max_run_duration = "3600s" + + # Tasks are grouped inside a job using TaskGroups. + group = batch_v1.TaskGroup() + group.task_count = 4 + group.task_spec = task + + # Policies are used to define on what kind of virtual machines the tasks will run on. + # In this case, we tell the system to use "e2-standard-4" machine type. + # Read more about machine types here: https://cloud.google.com/compute/docs/machine-types + allocation_policy = batch_v1.AllocationPolicy() + policy = batch_v1.AllocationPolicy.InstancePolicy() + policy.machine_type = "e2-standard-4" + instances = batch_v1.AllocationPolicy.InstancePolicyOrTemplate() + instances.policy = policy + allocation_policy.instances = [instances] + + job = batch_v1.Job() + job.task_groups = [group] + job.allocation_policy = allocation_policy + job.labels = {"env": "testing", "type": "script", "mount": "bucket"} + # We use Cloud Logging as it's an out of the box available option + job.logs_policy = batch_v1.LogsPolicy() + job.logs_policy.destination = batch_v1.LogsPolicy.Destination.CLOUD_LOGGING + + create_request = batch_v1.CreateJobRequest() + create_request.job = job + create_request.job_id = job_name + # The job's parent is the region in which the job will run + create_request.parent = f"projects/{project_id}/locations/{region}" + + return client.create_job(create_request) +# [END batch_create_script_job_with_bucket] diff --git a/compute/batch/snippets/tests/test_basics.py b/compute/batch/snippets/tests/test_basics.py index 88dfa75c0ef8..8897d8425ebc 100644 --- a/compute/batch/snippets/tests/test_basics.py +++ b/compute/batch/snippets/tests/test_basics.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. import time +from typing import Callable import uuid - import google.auth from google.cloud import batch_v1 import pytest @@ -44,7 +44,7 @@ def job_name(): return f"test-job-{uuid.uuid4().hex[:10]}" -def _test_body(test_job: batch_v1.Job): +def _test_body(test_job: batch_v1.Job, additional_test: Callable = None): start_time = time.time() try: while test_job.status.state in WAIT_STATES: @@ -61,6 +61,9 @@ def _test_body(test_job: batch_v1.Job): break else: pytest.fail(f"Couldn't find job {test_job.uid} on the list of jobs.") + + if additional_test: + additional_test() finally: delete_job(PROJECT, REGION, test_job.name.rsplit('/', maxsplit=1)[1]).result() diff --git a/compute/batch/snippets/tests/test_bucket.py b/compute/batch/snippets/tests/test_bucket.py new file mode 100644 index 000000000000..ad8a347fbba0 --- /dev/null +++ b/compute/batch/snippets/tests/test_bucket.py @@ -0,0 +1,70 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import uuid + + +import google.auth +from google.cloud import batch_v1 +from google.cloud import storage +import pytest + +from .test_basics import _test_body +from ..create.create_with_mounted_bucket import create_script_job_with_bucket + +PROJECT = google.auth.default()[1] +REGION = 'europe-north1' + +TIMEOUT = 600 # 10 minutes + +WAIT_STATES = { + batch_v1.JobStatus.State.STATE_UNSPECIFIED, + batch_v1.JobStatus.State.QUEUED, + batch_v1.JobStatus.State.RUNNING, + batch_v1.JobStatus.State.SCHEDULED, +} + + +@pytest.fixture +def job_name(): + return f"test-job-{uuid.uuid4().hex[:10]}" + + +@pytest.fixture() +def test_bucket(): + bucket_name = f"test-bucket-{uuid.uuid4().hex[:8]}" + client = storage.Client() + client.create_bucket(bucket_name, location="eu") + + yield bucket_name + + bucket = client.get_bucket(bucket_name) + bucket.delete(force=True) + + +def _test_bucket_content(test_bucket): + client = storage.Client() + bucket = client.get_bucket(test_bucket) + + file_name_template = "output_task_{task_number}.txt" + file_content_template = "Hello world from task {task_number}.\n" + + for i in range(4): + blob = bucket.blob(file_name_template.format(task_number=i)) + content = blob.download_as_bytes().decode() + assert content == file_content_template.format(task_number=i) + + +def test_bucket_job(job_name, test_bucket): + job = create_script_job_with_bucket(PROJECT, REGION, job_name, test_bucket) + _test_body(job, lambda: _test_bucket_content(test_bucket)) From 8695e997bae393d58b32ed0cad67dc99d427d872 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 10:53:57 -0400 Subject: [PATCH 12/31] chore: regenerate samples (#45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add an enum value for raw locations from Apple platforms PiperOrigin-RevId: 476961484 Source-Link: https://github.com/googleapis/googleapis/commit/695134be07e7f85a59eef40840fe693be51468e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/49457f9e7aae89cfe0491af4dbd9961a90125d32 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDk0NTdmOWU3YWFlODljZmUwNDkxYWY0ZGJkOTk2MWE5MDEyNWQzMiJ9 * 🦉 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 Co-authored-by: Anthonios Partheniou --- .../snippet_metadata_batch_v1.json | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json index 9a7609f6e058..d9597c063b4f 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", + "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" + "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", + "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" + "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", + "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" + "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", + "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" + "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", + "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" + "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", + "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" + "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" } ] } From 278d7e192c62f593b480ffe10ceecd7b2418f19b Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Fri, 30 Sep 2022 15:50:14 +0200 Subject: [PATCH 13/31] docs(samples): Adding samples for template usage (#41) Preparing another code sample. This time for the [`Create a job from a Compute Engine instance template`](https://cloud.google.com/batch/docs/create-run-job#create-job-instance-template) section. --- compute/batch/requirements-test.txt | 5 +- .../snippets/create/create_with_template.py | 87 +++++++++++++ compute/batch/snippets/tests/test_template.py | 114 ++++++++++++++++++ 3 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 compute/batch/snippets/create/create_with_template.py create mode 100644 compute/batch/snippets/tests/test_template.py diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index a30f83328b79..90982db710de 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,3 +1,4 @@ pytest==7.1.3 -pytest-parallel==0.1.1 -google-cloud-storage==2.5.0 +google-cloud-compute==1.5.2 +google-cloud-resource-manager==1.6.1 +google-cloud-storage==2.5.0 \ No newline at end of file diff --git a/compute/batch/snippets/create/create_with_template.py b/compute/batch/snippets/create/create_with_template.py new file mode 100644 index 000000000000..29da74c5ad72 --- /dev/null +++ b/compute/batch/snippets/create/create_with_template.py @@ -0,0 +1,87 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_create_job_with_template] +from google.cloud import batch_v1 + + +def create_script_job_with_template(project_id: str, region: str, job_name: str, template_link: str) -> batch_v1.Job: + """ + This method shows how to create a sample Batch Job that will run + a simple command on Cloud Compute instances created using a provided Template. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region you want to use to run the job. Regions that are + available for Batch are listed on: https://cloud.google.com/batch/docs/get-started#locations + job_name: the name of the job that will be created. + It needs to be unique for each project and region pair. + template_link: a link to an existing Instance Template. Acceptable formats: + * "projects/{project_id}/global/instanceTemplates/{template_name}" + * "{template_name}" - if the template is defined in the same project as used to create the Job. + + Returns: + A job object representing the job created. + """ + client = batch_v1.BatchServiceClient() + + # Define what will be done as part of the job. + task = batch_v1.TaskSpec() + runnable = batch_v1.Runnable() + runnable.script = batch_v1.Runnable.Script() + runnable.script.text = "echo Hello world! This is task ${BATCH_TASK_INDEX}. This job has a total of ${BATCH_TASK_COUNT} tasks." + # You can also run a script from a file. Just remember, that needs to be a script that's + # already on the VM that will be running the job. Using runnable.script.text and runnable.script.path is mutually + # exclusive. + # runnable.script.path = '/tmp/test.sh' + task.runnables = [runnable] + + # We can specify what resources are requested by each task. + resources = batch_v1.ComputeResource() + resources.cpu_milli = 2000 # in milliseconds per cpu-second. This means the task requires 2 whole CPUs. + resources.memory_mib = 16 + task.compute_resource = resources + + task.max_retry_count = 2 + task.max_run_duration = "3600s" + + # Tasks are grouped inside a job using TaskGroups. + group = batch_v1.TaskGroup() + group.task_count = 4 + group.task_spec = task + + # Policies are used to define on what kind of virtual machines the tasks will run on. + # In this case, we tell the system to use an instance template that defines all the + # required parameters. + allocation_policy = batch_v1.AllocationPolicy() + instances = batch_v1.AllocationPolicy.InstancePolicyOrTemplate() + instances.instance_template = template_link + allocation_policy.instances = [instances] + + job = batch_v1.Job() + job.task_groups = [group] + job.allocation_policy = allocation_policy + job.labels = {"env": "testing", "type": "script"} + # We use Cloud Logging as it's an out of the box available option + job.logs_policy = batch_v1.LogsPolicy() + job.logs_policy.destination = batch_v1.LogsPolicy.Destination.CLOUD_LOGGING + + create_request = batch_v1.CreateJobRequest() + create_request.job = job + create_request.job_id = job_name + # The job's parent is the region in which the job will run + create_request.parent = f"projects/{project_id}/locations/{region}" + + return client.create_job(create_request) +# [END batch_create_job_with_template] diff --git a/compute/batch/snippets/tests/test_template.py b/compute/batch/snippets/tests/test_template.py new file mode 100644 index 000000000000..572811731e0a --- /dev/null +++ b/compute/batch/snippets/tests/test_template.py @@ -0,0 +1,114 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import uuid + +import google.auth +from google.cloud import batch_v1 +from google.cloud import compute_v1 +from google.cloud import resourcemanager_v3 +import pytest + + +from .test_basics import _test_body + +from ..create.create_with_template import create_script_job_with_template + +PROJECT = google.auth.default()[1] + +PROJECT_NUMBER = resourcemanager_v3.ProjectsClient().get_project(name=f"projects/{PROJECT}").name.split("/")[1] + +REGION = 'europe-north1' + +TIMEOUT = 600 # 10 minutes + +WAIT_STATES = { + batch_v1.JobStatus.State.STATE_UNSPECIFIED, + batch_v1.JobStatus.State.QUEUED, + batch_v1.JobStatus.State.RUNNING, + batch_v1.JobStatus.State.SCHEDULED, +} + + +@pytest.fixture +def job_name(): + return f"test-job-{uuid.uuid4().hex[:10]}" + + +@pytest.fixture +def instance_template(): + disk = compute_v1.AttachedDisk() + initialize_params = compute_v1.AttachedDiskInitializeParams() + initialize_params.source_image = ( + "projects/ubuntu-os-cloud/global/images/family/ubuntu-2204-lts" + ) + initialize_params.disk_size_gb = 25 + initialize_params.disk_type = 'pd-balanced' + disk.initialize_params = initialize_params + disk.auto_delete = True + disk.boot = True + + network_interface = compute_v1.NetworkInterface() + network_interface.name = "global/networks/default" + + access = compute_v1.AccessConfig() + access.type_ = compute_v1.AccessConfig.Type.ONE_TO_ONE_NAT.name + access.name = "External NAT" + access.network_tier = access.NetworkTier.PREMIUM.name + network_interface.access_configs = [access] + + template = compute_v1.InstanceTemplate() + template.name = "test-template-" + uuid.uuid4().hex[:10] + template.properties = compute_v1.InstanceProperties() + template.properties.disks = [disk] + template.properties.machine_type = "e2-standard-16" + template.properties.network_interfaces = [network_interface] + + template.properties.scheduling = compute_v1.Scheduling() + template.properties.scheduling.on_host_maintenance = compute_v1.Scheduling.OnHostMaintenance.MIGRATE.name + template.properties.scheduling.provisioning_model = compute_v1.Scheduling.ProvisioningModel.STANDARD.name + template.properties.scheduling.automatic_restart = True + + template.properties.service_accounts = [ + { + "email": f"{PROJECT_NUMBER}-compute@developer.gserviceaccount.com", + "scopes": [ + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/logging.write", + "https://www.googleapis.com/auth/monitoring.write", + "https://www.googleapis.com/auth/servicecontrol", + "https://www.googleapis.com/auth/service.management.readonly", + "https://www.googleapis.com/auth/trace.append" + ] + } + ] + + template_client = compute_v1.InstanceTemplatesClient() + operation_client = compute_v1.GlobalOperationsClient() + op = template_client.insert_unary( + project=PROJECT, instance_template_resource=template + ) + operation_client.wait(project=PROJECT, operation=op.name) + + template = template_client.get(project=PROJECT, instance_template=template.name) + + yield template + + op = template_client.delete_unary(project=PROJECT, instance_template=template.name) + operation_client.wait(project=PROJECT, operation=op.name) + + +def test_template_job(job_name, instance_template): + job = create_script_job_with_template(PROJECT, REGION, job_name, instance_template.self_link) + _test_body(job) From 5932f3276a0e9e07321bc25b976b5a142d9f44e1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:43:38 -0400 Subject: [PATCH 14/31] chore: regenerate samples (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(bazel): update protobuf to v3.21.7 PiperOrigin-RevId: 477955264 Source-Link: https://github.com/googleapis/googleapis/commit/a724450af76d0001f23602684c49cd6a4b3a5654 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4abcbcaec855e74a0b22a4988cf9e0eb61a83094 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGFiY2JjYWVjODU1ZTc0YTBiMjJhNDk4OGNmOWUwZWI2MWE4MzA5NCJ9 * 🦉 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 --- .../snippet_metadata_batch_v1.json | 48 +++++++++---------- .../snippet_metadata_batch_v1alpha.json | 48 +++++++++---------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json index d9597c063b4f..9a7609f6e058 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", + "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" + "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", + "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" + "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", + "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" + "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", + "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" + "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", + "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" + "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", + "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" + "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" } ] } diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 79666153d05a..5a49807d0497 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" } ] } From 1de165566e1b2b6b0099c105d15db5b95e2a1825 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Mon, 3 Oct 2022 19:04:11 +0200 Subject: [PATCH 15/31] docs(samples): Adding samples for list and get tasks (#50) * Fixing tests * docs(samples): Adding samples for list tasks and get task Co-authored-by: Anthonios Partheniou --- .../create_with_container_no_mounting.py | 1 + .../create/create_with_mounted_bucket.py | 1 + .../create/create_with_script_no_mounting.py | 1 + .../snippets/create/create_with_template.py | 1 + compute/batch/snippets/get/get_task.py | 38 +++++++++++++++++++ compute/batch/snippets/list/list_jobs.py | 3 +- compute/batch/snippets/list/list_tasks.py | 37 ++++++++++++++++++ compute/batch/snippets/tests/test_basics.py | 16 ++++++-- 8 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 compute/batch/snippets/get/get_task.py create mode 100644 compute/batch/snippets/list/list_tasks.py diff --git a/compute/batch/snippets/create/create_with_container_no_mounting.py b/compute/batch/snippets/create/create_with_container_no_mounting.py index 9c54318f2a57..fd7f655e478b 100644 --- a/compute/batch/snippets/create/create_with_container_no_mounting.py +++ b/compute/batch/snippets/create/create_with_container_no_mounting.py @@ -54,6 +54,7 @@ def create_container_job(project_id: str, region: str, job_name: str) -> batch_v task.max_run_duration = "3600s" # Tasks are grouped inside a job using TaskGroups. + # Currently, it's possible to have only one task group. group = batch_v1.TaskGroup() group.task_count = 4 group.task_spec = task diff --git a/compute/batch/snippets/create/create_with_mounted_bucket.py b/compute/batch/snippets/create/create_with_mounted_bucket.py index 469df9c8994c..d64821cfa632 100644 --- a/compute/batch/snippets/create/create_with_mounted_bucket.py +++ b/compute/batch/snippets/create/create_with_mounted_bucket.py @@ -58,6 +58,7 @@ def create_script_job_with_bucket(project_id: str, region: str, job_name: str, b task.max_run_duration = "3600s" # Tasks are grouped inside a job using TaskGroups. + # Currently, it's possible to have only one task group. group = batch_v1.TaskGroup() group.task_count = 4 group.task_spec = task diff --git a/compute/batch/snippets/create/create_with_script_no_mounting.py b/compute/batch/snippets/create/create_with_script_no_mounting.py index 29942cb4d50d..87a1dfe680ad 100644 --- a/compute/batch/snippets/create/create_with_script_no_mounting.py +++ b/compute/batch/snippets/create/create_with_script_no_mounting.py @@ -54,6 +54,7 @@ def create_script_job(project_id: str, region: str, job_name: str) -> batch_v1.J task.max_run_duration = "3600s" # Tasks are grouped inside a job using TaskGroups. + # Currently, it's possible to have only one task group. group = batch_v1.TaskGroup() group.task_count = 4 group.task_spec = task diff --git a/compute/batch/snippets/create/create_with_template.py b/compute/batch/snippets/create/create_with_template.py index 29da74c5ad72..c37a94f9e352 100644 --- a/compute/batch/snippets/create/create_with_template.py +++ b/compute/batch/snippets/create/create_with_template.py @@ -57,6 +57,7 @@ def create_script_job_with_template(project_id: str, region: str, job_name: str, task.max_run_duration = "3600s" # Tasks are grouped inside a job using TaskGroups. + # Currently, it's possible to have only one task group. group = batch_v1.TaskGroup() group.task_count = 4 group.task_spec = task diff --git a/compute/batch/snippets/get/get_task.py b/compute/batch/snippets/get/get_task.py new file mode 100644 index 000000000000..ea5fc5c9c22f --- /dev/null +++ b/compute/batch/snippets/get/get_task.py @@ -0,0 +1,38 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_get_task] + +from google.cloud import batch_v1 + + +def get_task(project_id: str, region: str, job_name: str, group_name: str, task_number: int) -> batch_v1.Task: + """ + Retrieve information about a Task. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region hosts the job. + job_name: the name of the job you want to retrieve information about. + group_name: the name of the group that owns the task you want to check. Usually it's `group0`. + task_number: number of the task you want to look up. + + Returns: + A Task object representing the specified task. + """ + client = batch_v1.BatchServiceClient() + + return client.get_task(name=f"projects/{project_id}/locations/{region}/jobs/{job_name}" + f"/taskGroups/{group_name}/tasks/{task_number}") +# [END batch_get_task] diff --git a/compute/batch/snippets/list/list_jobs.py b/compute/batch/snippets/list/list_jobs.py index 77c39b5ce0cf..e52f4defe876 100644 --- a/compute/batch/snippets/list/list_jobs.py +++ b/compute/batch/snippets/list/list_jobs.py @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Iterable # [START batch_list_jobs] +from typing import Iterable + from google.cloud import batch_v1 diff --git a/compute/batch/snippets/list/list_tasks.py b/compute/batch/snippets/list/list_tasks.py new file mode 100644 index 000000000000..9ef6674ec8d1 --- /dev/null +++ b/compute/batch/snippets/list/list_tasks.py @@ -0,0 +1,37 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START batch_list_tasks] +from typing import Iterable + +from google.cloud import batch_v1 + + +def list_tasks(project_id: str, region: str, job_name: str, group_name: str) -> Iterable[batch_v1.Task]: + """ + Get a list of all jobs defined in given region. + + Args: + project_id: project ID or project number of the Cloud project you want to use. + region: name of the region hosting the jobs. + job_name: name of the job which tasks you want to list. + group_name: name of the group of tasks. Usually it's `group0`. + + Returns: + An iterable collection of Task objects. + """ + client = batch_v1.BatchServiceClient() + + return client.list_tasks(parent=f"projects/{project_id}/locations/{region}/jobs/{job_name}/taskGroups/{group_name}") +# [END batch_list_tasks] diff --git a/compute/batch/snippets/tests/test_basics.py b/compute/batch/snippets/tests/test_basics.py index 8897d8425ebc..980314d9f42b 100644 --- a/compute/batch/snippets/tests/test_basics.py +++ b/compute/batch/snippets/tests/test_basics.py @@ -24,7 +24,9 @@ from ..delete.delete_job import delete_job from ..get.get_job import get_job +from ..get.get_task import get_task from ..list.list_jobs import list_jobs +from ..list.list_tasks import list_tasks PROJECT = google.auth.default()[1] REGION = 'europe-north1' @@ -36,6 +38,7 @@ batch_v1.JobStatus.State.QUEUED, batch_v1.JobStatus.State.RUNNING, batch_v1.JobStatus.State.SCHEDULED, + batch_v1.JobStatus.State.DELETION_IN_PROGRESS } @@ -53,8 +56,7 @@ def _test_body(test_job: batch_v1.Job, additional_test: Callable = None): test_job = get_job(PROJECT, REGION, test_job.name.rsplit('/', maxsplit=1)[1]) time.sleep(5) - assert test_job.status.state in (batch_v1.JobStatus.State.SUCCEEDED, - batch_v1.JobStatus.State.DELETION_IN_PROGRESS) + assert test_job.status.state == batch_v1.JobStatus.State.SUCCEEDED for job in list_jobs(PROJECT, REGION): if test_job.uid == job.uid: @@ -72,9 +74,17 @@ def _test_body(test_job: batch_v1.Job, additional_test: Callable = None): pytest.fail("The test job should be deleted at this point!") +def _check_tasks(job_name): + tasks = list_tasks(PROJECT, REGION, job_name, 'group0') + assert len(list(tasks)) == 4 + for i in range(4): + assert get_task(PROJECT, REGION, job_name, 'group0', i) is not None + print('Tasks tested') + + def test_script_job(job_name): job = create_script_job(PROJECT, REGION, job_name) - _test_body(job) + _test_body(job, additional_test=lambda: _check_tasks(job_name)) def test_container_job(job_name): From fdfd474d7235c2e23808ca5b6730ac77590167e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 Oct 2022 03:09:50 +0200 Subject: [PATCH 16/31] chore(deps): update dependency google-cloud-resource-manager to v1.6.2 (#49) Co-authored-by: Anthonios Partheniou --- compute/batch/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index 90982db710de..1f8782deb15b 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,4 +1,4 @@ pytest==7.1.3 google-cloud-compute==1.5.2 -google-cloud-resource-manager==1.6.1 +google-cloud-resource-manager==1.6.2 google-cloud-storage==2.5.0 \ No newline at end of file From 11d84411ecd07a2322c53a8446e32e2d72182832 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 Oct 2022 03:32:45 +0200 Subject: [PATCH 17/31] chore(deps): update all dependencies (#51) --- compute/batch/requirements-test.txt | 2 +- compute/batch/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index 1f8782deb15b..d1808cb75698 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,4 +1,4 @@ pytest==7.1.3 -google-cloud-compute==1.5.2 +google-cloud-compute==1.6.0 google-cloud-resource-manager==1.6.2 google-cloud-storage==2.5.0 \ No newline at end of file diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index 0deda5cd796d..f55ea06559f2 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,3 @@ isort==5.10.1 black==22.8.0 -google-cloud-batch==0.3.0 +google-cloud-batch==0.3.1 From d540ed8dd4135f28b5deba91ce64f30419ad7208 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 8 Oct 2022 19:50:48 +0200 Subject: [PATCH 18/31] chore(deps): update dependency black to v22.10.0 (#52) --- compute/batch/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index f55ea06559f2..be9bb0e0c3a0 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,3 @@ isort==5.10.1 -black==22.8.0 +black==22.10.0 google-cloud-batch==0.3.1 From 7bca50de6cf0e449ccea2b0442d405c30f1c8835 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sun, 16 Oct 2022 09:40:13 +0000 Subject: [PATCH 19/31] docs: Refine GPU drivers installation proto description (#57) - [ ] Regenerate this pull request now. docs: Refine comments for deprecated proto fields docs: Update the API comments about the device_name PiperOrigin-RevId: 481282173 Source-Link: https://togithub.com/googleapis/googleapis/commit/e981f84f8a337561a114f8cf7d8f49b2c548228f Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/f550f5e45d7b9d5cf92be96db2de5cc2a8088c39 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjU1MGY1ZTQ1ZDdiOWQ1Y2Y5MmJlOTZkYjJkZTVjYzJhODA4OGMzOSJ9 feat: Enable install_gpu_drivers flag in v1 proto docs: Refine GPU drivers installation proto description docs: Refine comments for deprecated proto fields docs: Update the API comments about the device_name PiperOrigin-RevId: 481212993 Source-Link: https://togithub.com/googleapis/googleapis/commit/b037bb3b4ed91bdbdcc6e9ad9d3d641d914b93d2 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/60e247bd1082e706c42c115453214b9fb0354864 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjBlMjQ3YmQxMDgyZTcwNmM0MmMxMTU0NTMyMTRiOWZiMDM1NDg2NCJ9 --- .../snippet_metadata_batch_v1.json | 48 +++++++++---------- .../snippet_metadata_batch_v1alpha.json | 48 +++++++++---------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json index 9a7609f6e058..d9597c063b4f 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", + "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" + "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", + "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" + "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", + "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" + "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", + "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" + "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", + "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" + "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", + "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" + "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", + "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" + "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", + "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" + "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", + "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" + "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" } ] } diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json index 5a49807d0497..79666153d05a 100644 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json @@ -149,7 +149,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -185,7 +185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" }, { "canonical": true, @@ -237,7 +237,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", + "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", @@ -273,7 +273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" + "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" }, { "canonical": true, @@ -398,7 +398,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -434,7 +434,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" }, { "canonical": true, @@ -478,7 +478,7 @@ "shortName": "delete_job" }, "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", + "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", @@ -514,7 +514,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" + "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" }, { "canonical": true, @@ -639,7 +639,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -675,7 +675,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" }, { "canonical": true, @@ -719,7 +719,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", + "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", @@ -755,7 +755,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" + "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" }, { "canonical": true, @@ -880,7 +880,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -916,7 +916,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" }, { "canonical": true, @@ -960,7 +960,7 @@ "shortName": "get_task" }, "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", + "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", @@ -996,7 +996,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" + "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" }, { "canonical": true, @@ -1121,7 +1121,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1157,7 +1157,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" }, { "canonical": true, @@ -1201,7 +1201,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", + "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", @@ -1237,7 +1237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" + "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" }, { "canonical": true, @@ -1362,7 +1362,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1398,7 +1398,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" }, { "canonical": true, @@ -1442,7 +1442,7 @@ "shortName": "list_tasks" }, "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", + "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", @@ -1478,7 +1478,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" + "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" } ] } From a746f82ffb1bd85e4d6dc32ac10d3bb5efe4d003 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 17:31:19 +0200 Subject: [PATCH 20/31] chore(deps): update all dependencies (#55) Co-authored-by: Anthonios Partheniou --- compute/batch/requirements-test.txt | 4 ++-- compute/batch/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index d1808cb75698..8a1be6207af5 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,4 +1,4 @@ pytest==7.1.3 -google-cloud-compute==1.6.0 -google-cloud-resource-manager==1.6.2 +google-cloud-compute==1.6.1 +google-cloud-resource-manager==1.6.3 google-cloud-storage==2.5.0 \ No newline at end of file diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index be9bb0e0c3a0..9308bb97e049 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,3 @@ isort==5.10.1 black==22.10.0 -google-cloud-batch==0.3.1 +google-cloud-batch==0.3.2 From 03322170fb9adbd10ce7e1437075e8b891a93cf0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Oct 2022 14:58:30 +0200 Subject: [PATCH 21/31] chore(deps): update dependency google-cloud-batch to v0.4.0 (#61) --- compute/batch/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index 9308bb97e049..e3741b052715 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,3 @@ isort==5.10.1 black==22.10.0 -google-cloud-batch==0.3.2 +google-cloud-batch==0.4.0 From 88a0f4f1ed0586bebd33e1026c725c755d8dd595 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Oct 2022 12:55:15 +0200 Subject: [PATCH 22/31] chore(deps): update dependency pytest to v7.2.0 (#62) --- compute/batch/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index 8a1be6207af5..cac86699ec6b 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,4 +1,4 @@ -pytest==7.1.3 +pytest==7.2.0 google-cloud-compute==1.6.1 google-cloud-resource-manager==1.6.3 google-cloud-storage==2.5.0 \ No newline at end of file From f0fc663e5034b30b9d1db875113f2838cc6df8f4 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Thu, 27 Oct 2022 15:33:02 +0200 Subject: [PATCH 23/31] docs(samples): Adding code samples for log reading (#56) * docs(samples): Adding code samples for log reading Co-authored-by: Anthonios Partheniou --- compute/batch/requirements-test.txt | 2 +- compute/batch/requirements.txt | 1 + compute/batch/snippets/logs/read_job_logs.py | 39 ++++++++++++++++++++ compute/batch/snippets/tests/test_basics.py | 14 +++++-- 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 compute/batch/snippets/logs/read_job_logs.py diff --git a/compute/batch/requirements-test.txt b/compute/batch/requirements-test.txt index cac86699ec6b..586e344619cf 100644 --- a/compute/batch/requirements-test.txt +++ b/compute/batch/requirements-test.txt @@ -1,4 +1,4 @@ pytest==7.2.0 google-cloud-compute==1.6.1 google-cloud-resource-manager==1.6.3 -google-cloud-storage==2.5.0 \ No newline at end of file +google-cloud-storage==2.5.0 diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index e3741b052715..06ae926be2da 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,3 +1,4 @@ isort==5.10.1 black==22.10.0 google-cloud-batch==0.4.0 +google-cloud-logging==3.2.5 diff --git a/compute/batch/snippets/logs/read_job_logs.py b/compute/batch/snippets/logs/read_job_logs.py new file mode 100644 index 000000000000..d9c227a1082b --- /dev/null +++ b/compute/batch/snippets/logs/read_job_logs.py @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# [START batch_job_logs] +from typing import NoReturn + +from google.cloud import batch_v1 +from google.cloud import logging + + +def print_job_logs(project_id: str, job: batch_v1.Job) -> NoReturn: + """ + Prints the log messages created by given job. + + Args: + project_id: name of the project hosting the job. + job: the job which logs you want to print. + """ + # Initialize client that will be used to send requests across threads. This + # client only needs to be created once, and can be reused for multiple requests. + log_client = logging.Client(project=project_id) + logger = log_client.logger("batch_task_logs") + + for log_entry in logger.list_entries(filter_=f"labels.job_uid={job.uid}"): + print(log_entry.payload) + +# [END batch_job_logs] diff --git a/compute/batch/snippets/tests/test_basics.py b/compute/batch/snippets/tests/test_basics.py index 980314d9f42b..72a11f81385c 100644 --- a/compute/batch/snippets/tests/test_basics.py +++ b/compute/batch/snippets/tests/test_basics.py @@ -27,6 +27,7 @@ from ..get.get_task import get_task from ..list.list_jobs import list_jobs from ..list.list_tasks import list_tasks +from ..logs.read_job_logs import print_job_logs PROJECT = google.auth.default()[1] REGION = 'europe-north1' @@ -82,11 +83,18 @@ def _check_tasks(job_name): print('Tasks tested') -def test_script_job(job_name): +def _check_logs(job, capsys): + print_job_logs(PROJECT, job) + output = [line for line in capsys.readouterr().out.splitlines(keepends=False) if line != ""] + assert len(output) == 4 + assert all(log_msg.startswith("STDOUT") for log_msg in output) + + +def test_script_job(job_name, capsys): job = create_script_job(PROJECT, REGION, job_name) - _test_body(job, additional_test=lambda: _check_tasks(job_name)) + _test_body(job, additional_test=lambda: _check_logs(job, capsys)) def test_container_job(job_name): job = create_container_job(PROJECT, REGION, job_name) - _test_body(job) + _test_body(job, additional_test=lambda: _check_tasks(job_name)) From a099d6ce687a86ccd7f7a9cb1c083807178dddbd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 28 Oct 2022 14:21:29 +0200 Subject: [PATCH 24/31] chore(deps): update dependency google-cloud-batch to v0.4.1 (#64) --- compute/batch/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/requirements.txt b/compute/batch/requirements.txt index 06ae926be2da..7edc9015390f 100644 --- a/compute/batch/requirements.txt +++ b/compute/batch/requirements.txt @@ -1,4 +1,4 @@ isort==5.10.1 black==22.10.0 -google-cloud-batch==0.4.0 +google-cloud-batch==0.4.1 google-cloud-logging==3.2.5 From f18db24b95648e565831a45ba6c774f92974f47c Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Thu, 3 Nov 2022 14:27:57 +0100 Subject: [PATCH 25/31] Removing auto-generated files --- ...enerated_batch_service_create_job_async.py | 52 - ...generated_batch_service_create_job_sync.py | 52 - ..._batch_service_create_job_sync_2bc66fef.py | 52 - ..._batch_service_create_job_sync_6f38dd76.py | 52 - ...enerated_batch_service_delete_job_async.py | 55 - ...generated_batch_service_delete_job_sync.py | 55 - ..._batch_service_delete_job_sync_0196009c.py | 55 - ..._batch_service_delete_job_sync_91684552.py | 55 - ...1_generated_batch_service_get_job_async.py | 52 - ...v1_generated_batch_service_get_job_sync.py | 52 - ...ted_batch_service_get_job_sync_97ad7e29.py | 52 - ...ted_batch_service_get_job_sync_b06cc31b.py | 52 - ..._generated_batch_service_get_task_async.py | 52 - ...1_generated_batch_service_get_task_sync.py | 52 - ...ed_batch_service_get_task_sync_bbff024f.py | 52 - ...ed_batch_service_get_task_sync_fa6ae8a7.py | 52 - ...generated_batch_service_list_jobs_async.py | 52 - ..._generated_batch_service_list_jobs_sync.py | 52 - ...d_batch_service_list_jobs_sync_2430eb9c.py | 52 - ...d_batch_service_list_jobs_sync_d2310594.py | 52 - ...enerated_batch_service_list_tasks_async.py | 53 - ...generated_batch_service_list_tasks_sync.py | 53 - ..._batch_service_list_tasks_sync_9b3f04d1.py | 53 - ..._batch_service_list_tasks_sync_adf409cc.py | 53 - ...enerated_batch_service_create_job_async.py | 52 - ...generated_batch_service_create_job_sync.py | 52 - ..._batch_service_create_job_sync_eb4fa717.py | 52 - ..._batch_service_create_job_sync_ee80cfe8.py | 52 - ...enerated_batch_service_delete_job_async.py | 55 - ...generated_batch_service_delete_job_sync.py | 55 - ..._batch_service_delete_job_sync_18fb9154.py | 55 - ..._batch_service_delete_job_sync_affefd11.py | 55 - ...a_generated_batch_service_get_job_async.py | 52 - ...ha_generated_batch_service_get_job_sync.py | 52 - ...ted_batch_service_get_job_sync_1014e8c7.py | 52 - ...ted_batch_service_get_job_sync_17387e0a.py | 52 - ..._generated_batch_service_get_task_async.py | 52 - ...a_generated_batch_service_get_task_sync.py | 52 - ...ed_batch_service_get_task_sync_29b69ea9.py | 52 - ...ed_batch_service_get_task_sync_657a0e4c.py | 52 - ...generated_batch_service_list_jobs_async.py | 52 - ..._generated_batch_service_list_jobs_sync.py | 52 - ...d_batch_service_list_jobs_sync_21301b63.py | 52 - ...d_batch_service_list_jobs_sync_830dac29.py | 52 - ...enerated_batch_service_list_tasks_async.py | 53 - ...generated_batch_service_list_tasks_sync.py | 53 - ..._batch_service_list_tasks_sync_97ddc579.py | 53 - ..._batch_service_list_tasks_sync_af95f032.py | 53 - .../snippet_metadata_batch_v1.json | 1484 ----------------- .../snippet_metadata_batch_v1alpha.json | 1484 ----------------- 50 files changed, 5496 deletions(-) delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py delete mode 100644 compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py delete mode 100644 compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py delete mode 100644 compute/batch/generated_samples/snippet_metadata_batch_v1.json delete mode 100644 compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py deleted file mode 100644 index eb8d4756edd1..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_CreateJob_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -async def sample_create_job(): - # Create a client - client = batch_v1.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = await client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_CreateJob_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py deleted file mode 100644 index 77f1ed0c5597..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_CreateJob_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_create_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py deleted file mode 100644 index e3ae8a75ea92..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_2bc66fef.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_CreateJob_sync_2bc66fef] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_create_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_CreateJob_sync_2bc66fef] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py deleted file mode 100644 index d746f6c0d058..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_create_job_sync_6f38dd76.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_CreateJob_sync_6f38dd76] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_create_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_CreateJob_sync_6f38dd76] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py deleted file mode 100644 index 0af8acf09dfd..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_async.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_DeleteJob_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -async def sample_delete_job(): - # Create a client - client = batch_v1.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = await operation.result() - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_DeleteJob_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py deleted file mode 100644 index bdd382155152..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_DeleteJob_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_delete_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = operation.result() - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py deleted file mode 100644 index b00884b96287..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_0196009c.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_DeleteJob_sync_0196009c] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_delete_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = operation.result() - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_DeleteJob_sync_0196009c] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py deleted file mode 100644 index 664bb1f9f294..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_delete_job_sync_91684552.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_DeleteJob_sync_91684552] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_delete_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = operation.result() - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_DeleteJob_sync_91684552] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py deleted file mode 100644 index bacea0617874..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetJob_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -async def sample_get_job(): - # Create a client - client = batch_v1.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1.GetJobRequest( - name="name_value", - ) - - # Make the request - response = await client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetJob_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py deleted file mode 100644 index c4e818944068..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetJob_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_get_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.GetJobRequest( - name="name_value", - ) - - # Make the request - response = client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py deleted file mode 100644 index 7f399fbd464c..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_97ad7e29.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetJob_sync_97ad7e29] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_get_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.GetJobRequest( - name="name_value", - ) - - # Make the request - response = client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetJob_sync_97ad7e29] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py deleted file mode 100644 index b4d2f940facd..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_job_sync_b06cc31b.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetJob_sync_b06cc31b] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_get_job(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.GetJobRequest( - name="name_value", - ) - - # Make the request - response = client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetJob_sync_b06cc31b] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py deleted file mode 100644 index 154dc79cb70a..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetTask_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -async def sample_get_task(): - # Create a client - client = batch_v1.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = await client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetTask_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py deleted file mode 100644 index 059a72f903e7..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetTask_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_get_task(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py deleted file mode 100644 index 9fd310362f0a..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_bbff024f.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetTask_sync_bbff024f] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_get_task(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetTask_sync_bbff024f] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py deleted file mode 100644 index 74f5d0958257..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_GetTask_sync_fa6ae8a7] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_get_task(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1_generated_BatchService_GetTask_sync_fa6ae8a7] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py deleted file mode 100644 index db637c1d4850..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListJobs_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -async def sample_list_jobs(): - # Create a client - client = batch_v1.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListJobs_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py deleted file mode 100644 index 83dfb69e0bb6..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListJobs_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_list_jobs(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py deleted file mode 100644 index 4c5643c92dfb..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListJobs_sync_2430eb9c] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_list_jobs(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListJobs_sync_2430eb9c] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py deleted file mode 100644 index 5fffe7707541..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_jobs_sync_d2310594.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListJobs_sync_d2310594] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_list_jobs(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListJobs_sync_d2310594] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py deleted file mode 100644 index 6e90626ef126..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListTasks_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -async def sample_list_tasks(): - # Create a client - client = batch_v1.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListTasks_async] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py deleted file mode 100644 index 79e02ba0cbdc..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListTasks_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_list_tasks(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py deleted file mode 100644 index b8b50f246e51..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListTasks_sync_9b3f04d1] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_list_tasks(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListTasks_sync_9b3f04d1] diff --git a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py b/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py deleted file mode 100644 index 3e5bad8a4d8f..000000000000 --- a/compute/batch/generated_samples/batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1_generated_BatchService_ListTasks_sync_adf409cc] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1 - - -def sample_list_tasks(): - # Create a client - client = batch_v1.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1_generated_BatchService_ListTasks_sync_adf409cc] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py deleted file mode 100644 index b1602d7d9304..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_CreateJob_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -async def sample_create_job(): - # Create a client - client = batch_v1alpha.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1alpha.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = await client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_CreateJob_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py deleted file mode 100644 index 17a89f9903e7..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_CreateJob_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_create_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_CreateJob_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py deleted file mode 100644 index 90801c06d175..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_CreateJob_sync_eb4fa717] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_create_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_CreateJob_sync_eb4fa717] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py deleted file mode 100644 index 1c6700aaea68..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for CreateJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_CreateJob_sync_ee80cfe8] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_create_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.CreateJobRequest( - parent="parent_value", - ) - - # Make the request - response = client.create_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_CreateJob_sync_ee80cfe8] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py deleted file mode 100644 index 03efd1c7c02e..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_DeleteJob_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -async def sample_delete_job(): - # Create a client - client = batch_v1alpha.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1alpha.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = await operation.result() - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_DeleteJob_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py deleted file mode 100644 index b47ca5e80391..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_DeleteJob_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_delete_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = operation.result() - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_DeleteJob_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py deleted file mode 100644 index 52fb6a7d1d73..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_DeleteJob_sync_18fb9154] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_delete_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = operation.result() - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_DeleteJob_sync_18fb9154] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py deleted file mode 100644 index 0b33e6713319..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for DeleteJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_DeleteJob_sync_affefd11] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_delete_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.DeleteJobRequest( - ) - - # Make the request - operation = client.delete_job(request=request) - - print("Waiting for operation to complete...") - - response = operation.result() - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_DeleteJob_sync_affefd11] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py deleted file mode 100644 index 0b96db97f5ec..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetJob_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -async def sample_get_job(): - # Create a client - client = batch_v1alpha.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetJobRequest( - name="name_value", - ) - - # Make the request - response = await client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetJob_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py deleted file mode 100644 index 9a56b6501258..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetJob_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_get_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetJobRequest( - name="name_value", - ) - - # Make the request - response = client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetJob_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py deleted file mode 100644 index 0a6aa64e15a8..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetJob_sync_1014e8c7] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_get_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetJobRequest( - name="name_value", - ) - - # Make the request - response = client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetJob_sync_1014e8c7] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py deleted file mode 100644 index 0eb32471fcfd..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetJob -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetJob_sync_17387e0a] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_get_job(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetJobRequest( - name="name_value", - ) - - # Make the request - response = client.get_job(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetJob_sync_17387e0a] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py deleted file mode 100644 index 99e13d83ebcd..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetTask_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -async def sample_get_task(): - # Create a client - client = batch_v1alpha.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = await client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetTask_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py deleted file mode 100644 index bf8528fd8763..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetTask_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_get_task(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetTask_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py deleted file mode 100644 index a96957843c37..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetTask_sync_29b69ea9] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_get_task(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetTask_sync_29b69ea9] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py deleted file mode 100644 index 2404c5200e7d..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for GetTask -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_GetTask_sync_657a0e4c] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_get_task(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.GetTaskRequest( - name="name_value", - ) - - # Make the request - response = client.get_task(request=request) - - # Handle the response - print(response) - -# [END batch_v1alpha_generated_BatchService_GetTask_sync_657a0e4c] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py deleted file mode 100644 index ea3b0726fbd6..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_async.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListJobs_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -async def sample_list_jobs(): - # Create a client - client = batch_v1alpha.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListJobs_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py deleted file mode 100644 index 8a7a73898461..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListJobs_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_list_jobs(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListJobs_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py deleted file mode 100644 index 799f23360448..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListJobs_sync_21301b63] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_list_jobs(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListJobs_sync_21301b63] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py deleted file mode 100644 index 03cb615a3380..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListJobs -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListJobs_sync_830dac29] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_list_jobs(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListJobsRequest( - ) - - # Make the request - page_result = client.list_jobs(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListJobs_sync_830dac29] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py deleted file mode 100644 index a3f7cdf0fec8..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_async.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListTasks_async] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -async def sample_list_tasks(): - # Create a client - client = batch_v1alpha.BatchServiceAsyncClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - async for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListTasks_async] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py deleted file mode 100644 index 1e2f6c3099de..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListTasks_sync] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_list_tasks(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListTasks_sync] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py deleted file mode 100644 index 8c0ac9efc690..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListTasks_sync_97ddc579] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_list_tasks(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListTasks_sync_97ddc579] diff --git a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py b/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py deleted file mode 100644 index c584fda06f95..000000000000 --- a/compute/batch/generated_samples/batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Generated code. DO NOT EDIT! -# -# Snippet for ListTasks -# NOTE: This snippet has been automatically generated for illustrative purposes only. -# It may require modifications to work in your environment. - -# To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-batch - - -# [START batch_v1alpha_generated_BatchService_ListTasks_sync_af95f032] -# This snippet has been automatically generated and should be regarded as a -# code template only. -# It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in: -# https://googleapis.dev/python/google-api-core/latest/client_options.html -from google.cloud import batch_v1alpha - - -def sample_list_tasks(): - # Create a client - client = batch_v1alpha.BatchServiceClient() - - # Initialize request argument(s) - request = batch_v1alpha.ListTasksRequest( - parent="parent_value", - ) - - # Make the request - page_result = client.list_tasks(request=request) - - # Handle the response - for response in page_result: - print(response) - -# [END batch_v1alpha_generated_BatchService_ListTasks_sync_af95f032] diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1.json b/compute/batch/generated_samples/snippet_metadata_batch_v1.json deleted file mode 100644 index d9597c063b4f..000000000000 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1.json +++ /dev/null @@ -1,1484 +0,0 @@ -{ - "clientLibrary": { - "apis": [ - { - "id": "google.cloud.batch.v1", - "version": "v1" - } - ], - "language": "PYTHON", - "name": "google-cloud-batch" - }, - "snippets": [ - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.create_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "CreateJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.CreateJobRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "job", - "type": "google.cloud.batch_v1.types.Job" - }, - { - "name": "job_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Job", - "shortName": "create_job" - }, - "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_CreateJob_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_create_job_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.create_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "CreateJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.CreateJobRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "job", - "type": "google.cloud.batch_v1.types.Job" - }, - { - "name": "job_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Job", - "shortName": "create_job" - }, - "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_create_job_sync_6f38dd76.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.create_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "CreateJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.CreateJobRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "job", - "type": "google.cloud.batch_v1.types.Job" - }, - { - "name": "job_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Job", - "shortName": "create_job" - }, - "description": "Sample for CreateJob", - "file": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_CreateJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_create_job_sync_2bc66fef.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.delete_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "DeleteJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.DeleteJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.operation_async.AsyncOperation", - "shortName": "delete_job" - }, - "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 51, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "start": 52, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_delete_job_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.delete_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "DeleteJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.DeleteJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.operation.Operation", - "shortName": "delete_job" - }, - "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 51, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "start": 52, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_delete_job_sync_0196009c.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.delete_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "DeleteJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.DeleteJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.operation.Operation", - "shortName": "delete_job" - }, - "description": "Sample for DeleteJob", - "file": "batch_v1_generated_batch_service_delete_job_sync_91684552.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_DeleteJob_sync", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 51, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "start": 52, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_delete_job_sync_91684552.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.get_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.GetJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Job", - "shortName": "get_job" - }, - "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_GetJob_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_get_job_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.get_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.GetJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Job", - "shortName": "get_job" - }, - "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_GetJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_get_job_sync_b06cc31b.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.get_job", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.GetJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Job", - "shortName": "get_job" - }, - "description": "Sample for GetJob", - "file": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_GetJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_get_job_sync_97ad7e29.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.get_task", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetTask" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.GetTaskRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Task", - "shortName": "get_task" - }, - "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_GetTask_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_get_task_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.get_task", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetTask" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.GetTaskRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Task", - "shortName": "get_task" - }, - "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_GetTask_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_get_task_sync_fa6ae8a7.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.get_task", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetTask" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.GetTaskRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.types.Task", - "shortName": "get_task" - }, - "description": "Sample for GetTask", - "file": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_GetTask_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_get_task_sync_bbff024f.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.list_jobs", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListJobs" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.ListJobsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListJobsAsyncPager", - "shortName": "list_jobs" - }, - "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_ListJobs_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_list_jobs_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.list_jobs", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListJobs" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.ListJobsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListJobsPager", - "shortName": "list_jobs" - }, - "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_2430eb9c.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.list_jobs", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListJobs" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.ListJobsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListJobsPager", - "shortName": "list_jobs" - }, - "description": "Sample for ListJobs", - "file": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_ListJobs_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_list_jobs_sync_d2310594.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceAsyncClient.list_tasks", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListTasks" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.ListTasksRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListTasksAsyncPager", - "shortName": "list_tasks" - }, - "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_ListTasks_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_list_tasks_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.list_tasks", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListTasks" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.ListTasksRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListTasksPager", - "shortName": "list_tasks" - }, - "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_9b3f04d1.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1.BatchServiceClient.list_tasks", - "method": { - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "service": { - "fullName": "google.cloud.batch.v1.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListTasks" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1.types.ListTasksRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1.services.batch_service.pagers.ListTasksPager", - "shortName": "list_tasks" - }, - "description": "Sample for ListTasks", - "file": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1_generated_BatchService_ListTasks_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1_generated_batch_service_list_tasks_sync_adf409cc.py" - } - ] -} diff --git a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json b/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json deleted file mode 100644 index 79666153d05a..000000000000 --- a/compute/batch/generated_samples/snippet_metadata_batch_v1alpha.json +++ /dev/null @@ -1,1484 +0,0 @@ -{ - "clientLibrary": { - "apis": [ - { - "id": "google.cloud.batch.v1alpha", - "version": "v1alpha" - } - ], - "language": "PYTHON", - "name": "google-cloud-batch" - }, - "snippets": [ - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.create_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "CreateJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.CreateJobRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "job", - "type": "google.cloud.batch_v1alpha.types.Job" - }, - { - "name": "job_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Job", - "shortName": "create_job" - }, - "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_create_job_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.create_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "CreateJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.CreateJobRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "job", - "type": "google.cloud.batch_v1alpha.types.Job" - }, - { - "name": "job_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Job", - "shortName": "create_job" - }, - "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_ee80cfe8.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.create_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "CreateJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.CreateJobRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "job", - "type": "google.cloud.batch_v1alpha.types.Job" - }, - { - "name": "job_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Job", - "shortName": "create_job" - }, - "description": "Sample for CreateJob", - "file": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_create_job_sync_eb4fa717.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.delete_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "DeleteJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.DeleteJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.operation_async.AsyncOperation", - "shortName": "delete_job" - }, - "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 51, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "start": 52, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_delete_job_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.delete_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "DeleteJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.DeleteJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.operation.Operation", - "shortName": "delete_job" - }, - "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 51, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "start": 52, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_affefd11.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.delete_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "DeleteJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.DeleteJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.operation.Operation", - "shortName": "delete_job" - }, - "description": "Sample for DeleteJob", - "file": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_sync", - "segments": [ - { - "end": 54, - "start": 27, - "type": "FULL" - }, - { - "end": 54, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 51, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 55, - "start": 52, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_delete_job_sync_18fb9154.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.get_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.GetJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Job", - "shortName": "get_job" - }, - "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_get_job_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.GetJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Job", - "shortName": "get_job" - }, - "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_17387e0a.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_job", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetJob" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.GetJobRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Job", - "shortName": "get_job" - }, - "description": "Sample for GetJob", - "file": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_GetJob_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_get_job_sync_1014e8c7.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.get_task", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetTask" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.GetTaskRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Task", - "shortName": "get_task" - }, - "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_get_task_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_task", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetTask" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.GetTaskRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Task", - "shortName": "get_task" - }, - "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_657a0e4c.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.get_task", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "GetTask" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.GetTaskRequest" - }, - { - "name": "name", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.types.Task", - "shortName": "get_task" - }, - "description": "Sample for GetTask", - "file": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_GetTask_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_get_task_sync_29b69ea9.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.list_jobs", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListJobs" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.ListJobsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListJobsAsyncPager", - "shortName": "list_jobs" - }, - "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_jobs", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListJobs" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.ListJobsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListJobsPager", - "shortName": "list_jobs" - }, - "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_830dac29.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_jobs", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListJobs" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.ListJobsRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListJobsPager", - "shortName": "list_jobs" - }, - "description": "Sample for ListJobs", - "file": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 44, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 47, - "start": 45, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 48, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_list_jobs_sync_21301b63.py" - }, - { - "canonical": true, - "clientMethod": { - "async": true, - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient", - "shortName": "BatchServiceAsyncClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceAsyncClient.list_tasks", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListTasks" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.ListTasksRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListTasksAsyncPager", - "shortName": "list_tasks" - }, - "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_async.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_tasks", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListTasks" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.ListTasksRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListTasksPager", - "shortName": "list_tasks" - }, - "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_af95f032.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient", - "shortName": "BatchServiceClient" - }, - "fullName": "google.cloud.batch_v1alpha.BatchServiceClient.list_tasks", - "method": { - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "service": { - "fullName": "google.cloud.batch.v1alpha.BatchService", - "shortName": "BatchService" - }, - "shortName": "ListTasks" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.batch_v1alpha.types.ListTasksRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.batch_v1alpha.services.batch_service.pagers.ListTasksPager", - "shortName": "list_tasks" - }, - "description": "Sample for ListTasks", - "file": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "batch_v1alpha_generated_batch_service_list_tasks_sync_97ddc579.py" - } - ] -} From 02d34cffa96fd7dcc69395481879766069f41b44 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Thu, 3 Nov 2022 14:34:52 +0100 Subject: [PATCH 26/31] Removing noxfile --- compute/batch/noxfile.py | 313 --------------------------------------- 1 file changed, 313 deletions(-) delete mode 100644 compute/batch/noxfile.py diff --git a/compute/batch/noxfile.py b/compute/batch/noxfile.py deleted file mode 100644 index b053ca568f63..000000000000 --- a/compute/batch/noxfile.py +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import print_function - -import glob -import os -from pathlib import Path -import sys -from typing import Callable, Dict, List, Optional - -import nox - - -# WARNING - WARNING - WARNING - WARNING - WARNING -# WARNING - WARNING - WARNING - WARNING - WARNING -# DO NOT EDIT THIS FILE EVER! -# WARNING - WARNING - WARNING - WARNING - WARNING -# WARNING - WARNING - WARNING - WARNING - WARNING - -BLACK_VERSION = "black==22.3.0" -ISORT_VERSION = "isort==5.10.1" - -# Copy `noxfile_config.py` to your directory and modify it instead. - -# `TEST_CONFIG` dict is a configuration hook that allows users to -# modify the test configurations. The values here should be in sync -# with `noxfile_config.py`. Users will copy `noxfile_config.py` into -# their directory and modify it. - -TEST_CONFIG = { - # You can opt out from the test for specific Python versions. - "ignored_versions": [], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "enforce_type_hints": False, - # An envvar key for determining the project id to use. Change it - # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # If you need to use a specific version of pip, - # change pip_version_override to the string representation - # of the version number, for example, "20.2.4" - "pip_version_override": None, - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} - - -try: - # Ensure we can import noxfile_config in the project's directory. - sys.path.append(".") - from noxfile_config import TEST_CONFIG_OVERRIDE -except ImportError as e: - print("No user noxfile_config found: detail: {}".format(e)) - TEST_CONFIG_OVERRIDE = {} - -# Update the TEST_CONFIG with the user supplied values. -TEST_CONFIG.update(TEST_CONFIG_OVERRIDE) - - -def get_pytest_env_vars() -> Dict[str, str]: - """Returns a dict for pytest invocation.""" - ret = {} - - # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG["gcloud_project_env"] - # This should error out if not set. - ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] - - # Apply user supplied envs. - ret.update(TEST_CONFIG["envs"]) - return ret - - -# DO NOT EDIT - automatically generated. -# All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] - -# Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] - -TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) - -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( - "True", - "true", -) - -# Error if a python version is missing -nox.options.error_on_missing_interpreters = True - -# -# Style Checks -# - - -def _determine_local_import_names(start_dir: str) -> List[str]: - """Determines all import names that should be considered "local". - - This is used when running the linter to insure that import order is - properly checked. - """ - file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)] - return [ - basename - for basename, extension in file_ext_pairs - if extension == ".py" - or os.path.isdir(os.path.join(start_dir, basename)) - and basename not in ("__pycache__") - ] - - -# Linting with flake8. -# -# We ignore the following rules: -# E203: whitespace before ‘:’ -# E266: too many leading ‘#’ for block comment -# E501: line too long -# I202: Additional newline in a section of imports -# -# We also need to specify the rules which are ignored by default: -# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] -FLAKE8_COMMON_ARGS = [ - "--show-source", - "--builtin=gettext", - "--max-complexity=20", - "--import-order-style=google", - "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", - "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", - "--max-line-length=88", -] - - -@nox.session -def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG["enforce_type_hints"]: - session.install("flake8", "flake8-import-order") - else: - session.install("flake8", "flake8-import-order", "flake8-annotations") - - local_names = _determine_local_import_names(".") - args = FLAKE8_COMMON_ARGS + [ - "--application-import-names", - ",".join(local_names), - ".", - ] - session.run("flake8", *args) - - -# -# Black -# - - -@nox.session -def blacken(session: nox.sessions.Session) -> None: - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - python_files = [path for path in os.listdir(".") if path.endswith(".py")] - - session.run("black", *python_files) - - -# -# format = isort + black -# - - -@nox.session -def format(session: nox.sessions.Session) -> None: - """ - Run isort to sort imports. Then run black - to format code to uniform standard. - """ - session.install(BLACK_VERSION, ISORT_VERSION) - python_files = [path for path in os.listdir(".") if path.endswith(".py")] - - # Use the --fss option to sort imports using strict alphabetical order. - # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections - session.run("isort", "--fss", *python_files) - session.run("black", *python_files) - - -# -# Sample Tests -# - - -PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] - - -def _session_tests( - session: nox.sessions.Session, post_install: Callable = None -) -> None: - # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( - "**/test_*.py", recursive=True - ) - test_list.extend(glob.glob("**/tests", recursive=True)) - - if len(test_list) == 0: - print("No tests found, skipping directory.") - return - - if TEST_CONFIG["pip_version_override"]: - pip_version = TEST_CONFIG["pip_version_override"] - session.install(f"pip=={pip_version}") - """Runs py.test for a particular project.""" - concurrent_args = [] - if os.path.exists("requirements.txt"): - if os.path.exists("constraints.txt"): - session.install("-r", "requirements.txt", "-c", "constraints.txt") - else: - session.install("-r", "requirements.txt") - with open("requirements.txt") as rfile: - packages = rfile.read() - - if os.path.exists("requirements-test.txt"): - if os.path.exists("constraints-test.txt"): - session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") - else: - session.install("-r", "requirements-test.txt") - with open("requirements-test.txt") as rtfile: - packages += rtfile.read() - - if INSTALL_LIBRARY_FROM_SOURCE: - session.install("-e", _get_repo_root()) - - if post_install: - post_install(session) - - if "pytest-parallel" in packages: - concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) - elif "pytest-xdist" in packages: - concurrent_args.extend(["-n", "auto"]) - - session.run( - "pytest", - *(PYTEST_COMMON_ARGS + session.posargs + concurrent_args), - # Pytest will return 5 when no tests are collected. This can happen - # on travis where slow and flaky tests are excluded. - # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html - success_codes=[0, 5], - env=get_pytest_env_vars(), - ) - - -@nox.session(python=ALL_VERSIONS) -def py(session: nox.sessions.Session) -> None: - """Runs py.test for a sample using the specified version of Python.""" - if session.python in TESTED_VERSIONS: - _session_tests(session) - else: - session.skip( - "SKIPPED: {} tests are disabled for this sample.".format(session.python) - ) - - -# -# Readmegen -# - - -def _get_repo_root() -> Optional[str]: - """Returns the root folder of the project.""" - # Get root of this repository. Assume we don't have directories nested deeper than 10 items. - p = Path(os.getcwd()) - for i in range(10): - if p is None: - break - if Path(p / ".git").exists(): - return str(p) - # .git is not available in repos cloned via Cloud Build - # setup.py is always in the library's root, so use that instead - # https://github.com/googleapis/synthtool/issues/792 - if Path(p / "setup.py").exists(): - return str(p) - p = p.parent - raise Exception("Unable to detect repository root.") - - -GENERATED_READMES = sorted([x for x in Path(".").rglob("*.rst.in")]) - - -@nox.session -@nox.parametrize("path", GENERATED_READMES) -def readmegen(session: nox.sessions.Session, path: str) -> None: - """(Re-)generates the readme for a sample.""" - session.install("jinja2", "pyyaml") - dir_ = os.path.dirname(path) - - if os.path.exists(os.path.join(dir_, "requirements.txt")): - session.install("-r", os.path.join(dir_, "requirements.txt")) - - in_file = os.path.join(dir_, "README.rst.in") - session.run( - "python", _get_repo_root() + "/scripts/readme-gen/readme_gen.py", in_file - ) From 0fb0b719d1b637e8d181c93ec8cb78746e69c6a2 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Thu, 3 Nov 2022 15:26:03 +0100 Subject: [PATCH 27/31] feat: Tests in subdericteries get properly detected Catching up to match synthtool noxfile template. --- noxfile-template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile-template.py b/noxfile-template.py index 65296a981f06..6dd20085eb67 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -183,8 +183,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("*_test.py") + glob.glob("test_*.py") - test_list.extend(glob.glob("tests")) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: print("No tests found, skipping directory.") From c9a9268b1c87674deba717084ff92f4c935e07e0 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Mon, 7 Nov 2022 15:27:30 +0100 Subject: [PATCH 28/31] Fixing the test --- compute/batch/snippets/tests/test_basics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compute/batch/snippets/tests/test_basics.py b/compute/batch/snippets/tests/test_basics.py index 72a11f81385c..829a92729062 100644 --- a/compute/batch/snippets/tests/test_basics.py +++ b/compute/batch/snippets/tests/test_basics.py @@ -87,7 +87,7 @@ def _check_logs(job, capsys): print_job_logs(PROJECT, job) output = [line for line in capsys.readouterr().out.splitlines(keepends=False) if line != ""] assert len(output) == 4 - assert all(log_msg.startswith("STDOUT") for log_msg in output) + assert all("Hello world!" in log_msg for log_msg in output) def test_script_job(job_name, capsys): From 65fda721ab65f9e1e07606db3650ee986e16e108 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Mon, 14 Nov 2022 13:50:44 +0100 Subject: [PATCH 29/31] Reverting noxfile changes and adjusting folder structure. --- compute/batch/{snippets => create}/__init__.py | 0 .../create/create_with_container_no_mounting.py | 0 .../batch/{snippets => }/create/create_with_mounted_bucket.py | 0 .../{snippets => }/create/create_with_script_no_mounting.py | 0 compute/batch/{snippets => }/create/create_with_template.py | 0 compute/batch/{snippets => }/delete/delete_job.py | 0 compute/batch/{snippets => }/get/get_job.py | 0 compute/batch/{snippets => }/get/get_task.py | 0 compute/batch/{snippets => }/list/list_jobs.py | 0 compute/batch/{snippets => }/list/list_tasks.py | 0 compute/batch/{snippets => }/logs/read_job_logs.py | 0 compute/batch/snippets/tests/__init__.py | 0 compute/batch/{snippets/create => tests}/__init__.py | 0 compute/batch/{snippets => }/tests/test_basics.py | 0 compute/batch/{snippets => }/tests/test_bucket.py | 0 compute/batch/{snippets => }/tests/test_template.py | 0 noxfile-template.py | 4 ++-- 17 files changed, 2 insertions(+), 2 deletions(-) rename compute/batch/{snippets => create}/__init__.py (100%) rename compute/batch/{snippets => }/create/create_with_container_no_mounting.py (100%) rename compute/batch/{snippets => }/create/create_with_mounted_bucket.py (100%) rename compute/batch/{snippets => }/create/create_with_script_no_mounting.py (100%) rename compute/batch/{snippets => }/create/create_with_template.py (100%) rename compute/batch/{snippets => }/delete/delete_job.py (100%) rename compute/batch/{snippets => }/get/get_job.py (100%) rename compute/batch/{snippets => }/get/get_task.py (100%) rename compute/batch/{snippets => }/list/list_jobs.py (100%) rename compute/batch/{snippets => }/list/list_tasks.py (100%) rename compute/batch/{snippets => }/logs/read_job_logs.py (100%) delete mode 100644 compute/batch/snippets/tests/__init__.py rename compute/batch/{snippets/create => tests}/__init__.py (100%) rename compute/batch/{snippets => }/tests/test_basics.py (100%) rename compute/batch/{snippets => }/tests/test_bucket.py (100%) rename compute/batch/{snippets => }/tests/test_template.py (100%) diff --git a/compute/batch/snippets/__init__.py b/compute/batch/create/__init__.py similarity index 100% rename from compute/batch/snippets/__init__.py rename to compute/batch/create/__init__.py diff --git a/compute/batch/snippets/create/create_with_container_no_mounting.py b/compute/batch/create/create_with_container_no_mounting.py similarity index 100% rename from compute/batch/snippets/create/create_with_container_no_mounting.py rename to compute/batch/create/create_with_container_no_mounting.py diff --git a/compute/batch/snippets/create/create_with_mounted_bucket.py b/compute/batch/create/create_with_mounted_bucket.py similarity index 100% rename from compute/batch/snippets/create/create_with_mounted_bucket.py rename to compute/batch/create/create_with_mounted_bucket.py diff --git a/compute/batch/snippets/create/create_with_script_no_mounting.py b/compute/batch/create/create_with_script_no_mounting.py similarity index 100% rename from compute/batch/snippets/create/create_with_script_no_mounting.py rename to compute/batch/create/create_with_script_no_mounting.py diff --git a/compute/batch/snippets/create/create_with_template.py b/compute/batch/create/create_with_template.py similarity index 100% rename from compute/batch/snippets/create/create_with_template.py rename to compute/batch/create/create_with_template.py diff --git a/compute/batch/snippets/delete/delete_job.py b/compute/batch/delete/delete_job.py similarity index 100% rename from compute/batch/snippets/delete/delete_job.py rename to compute/batch/delete/delete_job.py diff --git a/compute/batch/snippets/get/get_job.py b/compute/batch/get/get_job.py similarity index 100% rename from compute/batch/snippets/get/get_job.py rename to compute/batch/get/get_job.py diff --git a/compute/batch/snippets/get/get_task.py b/compute/batch/get/get_task.py similarity index 100% rename from compute/batch/snippets/get/get_task.py rename to compute/batch/get/get_task.py diff --git a/compute/batch/snippets/list/list_jobs.py b/compute/batch/list/list_jobs.py similarity index 100% rename from compute/batch/snippets/list/list_jobs.py rename to compute/batch/list/list_jobs.py diff --git a/compute/batch/snippets/list/list_tasks.py b/compute/batch/list/list_tasks.py similarity index 100% rename from compute/batch/snippets/list/list_tasks.py rename to compute/batch/list/list_tasks.py diff --git a/compute/batch/snippets/logs/read_job_logs.py b/compute/batch/logs/read_job_logs.py similarity index 100% rename from compute/batch/snippets/logs/read_job_logs.py rename to compute/batch/logs/read_job_logs.py diff --git a/compute/batch/snippets/tests/__init__.py b/compute/batch/snippets/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/compute/batch/snippets/create/__init__.py b/compute/batch/tests/__init__.py similarity index 100% rename from compute/batch/snippets/create/__init__.py rename to compute/batch/tests/__init__.py diff --git a/compute/batch/snippets/tests/test_basics.py b/compute/batch/tests/test_basics.py similarity index 100% rename from compute/batch/snippets/tests/test_basics.py rename to compute/batch/tests/test_basics.py diff --git a/compute/batch/snippets/tests/test_bucket.py b/compute/batch/tests/test_bucket.py similarity index 100% rename from compute/batch/snippets/tests/test_bucket.py rename to compute/batch/tests/test_bucket.py diff --git a/compute/batch/snippets/tests/test_template.py b/compute/batch/tests/test_template.py similarity index 100% rename from compute/batch/snippets/tests/test_template.py rename to compute/batch/tests/test_template.py diff --git a/noxfile-template.py b/noxfile-template.py index 6dd20085eb67..65296a981f06 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -183,8 +183,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) - test_list.extend(glob.glob("**/tests", recursive=True)) + test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + test_list.extend(glob.glob("tests")) if len(test_list) == 0: print("No tests found, skipping directory.") From a7633f23170643a73a2bd6ca1c0f4f7f7205ab64 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Tue, 15 Nov 2022 15:28:28 +0100 Subject: [PATCH 30/31] Moving batch to separate top level dir --- {compute/batch => batch}/__init__.py | 0 {compute/batch => batch}/create/__init__.py | 0 .../batch => batch}/create/create_with_container_no_mounting.py | 0 {compute/batch => batch}/create/create_with_mounted_bucket.py | 0 {compute/batch => batch}/create/create_with_script_no_mounting.py | 0 {compute/batch => batch}/create/create_with_template.py | 0 {compute/batch => batch}/delete/delete_job.py | 0 {compute/batch => batch}/get/get_job.py | 0 {compute/batch => batch}/get/get_task.py | 0 {compute/batch => batch}/list/list_jobs.py | 0 {compute/batch => batch}/list/list_tasks.py | 0 {compute/batch => batch}/logs/read_job_logs.py | 0 {compute/batch => batch}/noxfile_config.py | 0 {compute/batch => batch}/requirements-test.txt | 0 {compute/batch => batch}/requirements.txt | 0 {compute/batch => batch}/tests/__init__.py | 0 {compute/batch => batch}/tests/test_basics.py | 0 {compute/batch => batch}/tests/test_bucket.py | 0 {compute/batch => batch}/tests/test_template.py | 0 19 files changed, 0 insertions(+), 0 deletions(-) rename {compute/batch => batch}/__init__.py (100%) rename {compute/batch => batch}/create/__init__.py (100%) rename {compute/batch => batch}/create/create_with_container_no_mounting.py (100%) rename {compute/batch => batch}/create/create_with_mounted_bucket.py (100%) rename {compute/batch => batch}/create/create_with_script_no_mounting.py (100%) rename {compute/batch => batch}/create/create_with_template.py (100%) rename {compute/batch => batch}/delete/delete_job.py (100%) rename {compute/batch => batch}/get/get_job.py (100%) rename {compute/batch => batch}/get/get_task.py (100%) rename {compute/batch => batch}/list/list_jobs.py (100%) rename {compute/batch => batch}/list/list_tasks.py (100%) rename {compute/batch => batch}/logs/read_job_logs.py (100%) rename {compute/batch => batch}/noxfile_config.py (100%) rename {compute/batch => batch}/requirements-test.txt (100%) rename {compute/batch => batch}/requirements.txt (100%) rename {compute/batch => batch}/tests/__init__.py (100%) rename {compute/batch => batch}/tests/test_basics.py (100%) rename {compute/batch => batch}/tests/test_bucket.py (100%) rename {compute/batch => batch}/tests/test_template.py (100%) diff --git a/compute/batch/__init__.py b/batch/__init__.py similarity index 100% rename from compute/batch/__init__.py rename to batch/__init__.py diff --git a/compute/batch/create/__init__.py b/batch/create/__init__.py similarity index 100% rename from compute/batch/create/__init__.py rename to batch/create/__init__.py diff --git a/compute/batch/create/create_with_container_no_mounting.py b/batch/create/create_with_container_no_mounting.py similarity index 100% rename from compute/batch/create/create_with_container_no_mounting.py rename to batch/create/create_with_container_no_mounting.py diff --git a/compute/batch/create/create_with_mounted_bucket.py b/batch/create/create_with_mounted_bucket.py similarity index 100% rename from compute/batch/create/create_with_mounted_bucket.py rename to batch/create/create_with_mounted_bucket.py diff --git a/compute/batch/create/create_with_script_no_mounting.py b/batch/create/create_with_script_no_mounting.py similarity index 100% rename from compute/batch/create/create_with_script_no_mounting.py rename to batch/create/create_with_script_no_mounting.py diff --git a/compute/batch/create/create_with_template.py b/batch/create/create_with_template.py similarity index 100% rename from compute/batch/create/create_with_template.py rename to batch/create/create_with_template.py diff --git a/compute/batch/delete/delete_job.py b/batch/delete/delete_job.py similarity index 100% rename from compute/batch/delete/delete_job.py rename to batch/delete/delete_job.py diff --git a/compute/batch/get/get_job.py b/batch/get/get_job.py similarity index 100% rename from compute/batch/get/get_job.py rename to batch/get/get_job.py diff --git a/compute/batch/get/get_task.py b/batch/get/get_task.py similarity index 100% rename from compute/batch/get/get_task.py rename to batch/get/get_task.py diff --git a/compute/batch/list/list_jobs.py b/batch/list/list_jobs.py similarity index 100% rename from compute/batch/list/list_jobs.py rename to batch/list/list_jobs.py diff --git a/compute/batch/list/list_tasks.py b/batch/list/list_tasks.py similarity index 100% rename from compute/batch/list/list_tasks.py rename to batch/list/list_tasks.py diff --git a/compute/batch/logs/read_job_logs.py b/batch/logs/read_job_logs.py similarity index 100% rename from compute/batch/logs/read_job_logs.py rename to batch/logs/read_job_logs.py diff --git a/compute/batch/noxfile_config.py b/batch/noxfile_config.py similarity index 100% rename from compute/batch/noxfile_config.py rename to batch/noxfile_config.py diff --git a/compute/batch/requirements-test.txt b/batch/requirements-test.txt similarity index 100% rename from compute/batch/requirements-test.txt rename to batch/requirements-test.txt diff --git a/compute/batch/requirements.txt b/batch/requirements.txt similarity index 100% rename from compute/batch/requirements.txt rename to batch/requirements.txt diff --git a/compute/batch/tests/__init__.py b/batch/tests/__init__.py similarity index 100% rename from compute/batch/tests/__init__.py rename to batch/tests/__init__.py diff --git a/compute/batch/tests/test_basics.py b/batch/tests/test_basics.py similarity index 100% rename from compute/batch/tests/test_basics.py rename to batch/tests/test_basics.py diff --git a/compute/batch/tests/test_bucket.py b/batch/tests/test_bucket.py similarity index 100% rename from compute/batch/tests/test_bucket.py rename to batch/tests/test_bucket.py diff --git a/compute/batch/tests/test_template.py b/batch/tests/test_template.py similarity index 100% rename from compute/batch/tests/test_template.py rename to batch/tests/test_template.py From abbb0714a80ae71aadb2f6b123db31d0ad7e3035 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Tue, 15 Nov 2022 15:39:48 +0100 Subject: [PATCH 31/31] Adding batch info --- .github/CODEOWNERS | 3 ++- .github/blunderbuss.yml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b8ca6cb4be0d..7f85efce1a2e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,6 +20,7 @@ /appengine/flexible/django_cloudsql/**/* @glasnt @GoogleCloudPlatform/aap-dpes @GoogleCloudPlatform/python-samples-reviewers /appengine/standard_python3/spanner/* @GoogleCloudPlatform/api-spanner-python @GoogleCloudPlatform/python-samples-reviewers /auth/**/* @arithmetic1728 @GoogleCloudPlatform/python-samples-reviewers +/batch/**/* @m-strzelczyk @GoogleCloudPlatform/dee-infra @GoogleCloudPlatform/python-samples-reviewers /bigquery/**/* @chalmerlowe @GoogleCloudPlatform/python-samples-reviewers /bigquery/remote_function/**/* @autoerr @GoogleCloudPlatform/python-samples-reviewers /billing/**/* @GoogleCloudPlatform/billing-samples-maintainers @GoogleCloudPlatform/python-samples-reviewers @@ -29,7 +30,7 @@ /cloud-sql/**/* @GoogleCloudPlatform/infra-db-dpes @GoogleCloudPlatform/python-samples-reviewers /codelabs/**/* @GoogleCloudPlatform/python-samples-reviewers /composer/**/* @leahecole @rachael-ds @rafalbiegacz @GoogleCloudPlatform/python-samples-reviewers -/compute/**/* @m-strzelczyk @GoogleCloudPlatform/python-samples-reviewers +/compute/**/* @m-strzelczyk @GoogleCloudPlatform/dee-infra @GoogleCloudPlatform/python-samples-reviewers /container/**/* @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/python-samples-reviewers /data-science-onramp/ @leahecole @bradmiro @GoogleCloudPlatform/python-samples-reviewers /dataflow/**/* @davidcavazos @GoogleCloudPlatform/python-samples-reviewers diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 5a26676163b6..b6e017af18fc 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -25,6 +25,10 @@ assign_issues_by: - 'api: auth' to: - arithmetic1728 +- labels: + - 'api: batch' + to: + - m-strzelczyk - labels: - 'api: bigquery' to: