-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,544 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
45 changes: 45 additions & 0 deletions
45
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_create_job_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
48 changes: 48 additions & 0 deletions
48
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
48 changes: 48 additions & 0 deletions
48
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_delete_job_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
45 changes: 45 additions & 0 deletions
45
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
45 changes: 45 additions & 0 deletions
45
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_job_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
45 changes: 45 additions & 0 deletions
45
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
45 changes: 45 additions & 0 deletions
45
compute/batch/generated_samples/batch_v1alpha_generated_batch_service_get_task_sync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
Oops, something went wrong.