Skip to content

Commit

Permalink
docs: add generated snippets (#192)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 11, 2022
1 parent 2dddd3d commit 58cf4aa
Show file tree
Hide file tree
Showing 136 changed files with 14,428 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CancelOperation
# 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-container


# [START container_generated_container_v1_ClusterManager_CancelOperation_async]
from google.cloud import container_v1


async def sample_cancel_operation():
# Create a client
client = container_v1.ClusterManagerAsyncClient()

# Initialize request argument(s)
request = container_v1.CancelOperationRequest(
)

# Make the request
await client.cancel_operation(request=request)


# [END container_generated_container_v1_ClusterManager_CancelOperation_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CancelOperation
# 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-container


# [START container_generated_container_v1_ClusterManager_CancelOperation_sync]
from google.cloud import container_v1


def sample_cancel_operation():
# Create a client
client = container_v1.ClusterManagerClient()

# Initialize request argument(s)
request = container_v1.CancelOperationRequest(
)

# Make the request
client.cancel_operation(request=request)


# [END container_generated_container_v1_ClusterManager_CancelOperation_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CompleteIPRotation
# 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-container


# [START container_generated_container_v1_ClusterManager_CompleteIPRotation_async]
from google.cloud import container_v1


async def sample_complete_ip_rotation():
# Create a client
client = container_v1.ClusterManagerAsyncClient()

# Initialize request argument(s)
request = container_v1.CompleteIPRotationRequest(
)

# Make the request
response = await client.complete_ip_rotation(request=request)

# Handle the response
print(response)

# [END container_generated_container_v1_ClusterManager_CompleteIPRotation_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CompleteIPRotation
# 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-container


# [START container_generated_container_v1_ClusterManager_CompleteIPRotation_sync]
from google.cloud import container_v1


def sample_complete_ip_rotation():
# Create a client
client = container_v1.ClusterManagerClient()

# Initialize request argument(s)
request = container_v1.CompleteIPRotationRequest(
)

# Make the request
response = client.complete_ip_rotation(request=request)

# Handle the response
print(response)

# [END container_generated_container_v1_ClusterManager_CompleteIPRotation_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CreateCluster
# 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-container


# [START container_generated_container_v1_ClusterManager_CreateCluster_async]
from google.cloud import container_v1


async def sample_create_cluster():
# Create a client
client = container_v1.ClusterManagerAsyncClient()

# Initialize request argument(s)
request = container_v1.CreateClusterRequest(
)

# Make the request
response = await client.create_cluster(request=request)

# Handle the response
print(response)

# [END container_generated_container_v1_ClusterManager_CreateCluster_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CreateCluster
# 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-container


# [START container_generated_container_v1_ClusterManager_CreateCluster_sync]
from google.cloud import container_v1


def sample_create_cluster():
# Create a client
client = container_v1.ClusterManagerClient()

# Initialize request argument(s)
request = container_v1.CreateClusterRequest(
)

# Make the request
response = client.create_cluster(request=request)

# Handle the response
print(response)

# [END container_generated_container_v1_ClusterManager_CreateCluster_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CreateNodePool
# 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-container


# [START container_generated_container_v1_ClusterManager_CreateNodePool_async]
from google.cloud import container_v1


async def sample_create_node_pool():
# Create a client
client = container_v1.ClusterManagerAsyncClient()

# Initialize request argument(s)
request = container_v1.CreateNodePoolRequest(
)

# Make the request
response = await client.create_node_pool(request=request)

# Handle the response
print(response)

# [END container_generated_container_v1_ClusterManager_CreateNodePool_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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 CreateNodePool
# 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-container


# [START container_generated_container_v1_ClusterManager_CreateNodePool_sync]
from google.cloud import container_v1


def sample_create_node_pool():
# Create a client
client = container_v1.ClusterManagerClient()

# Initialize request argument(s)
request = container_v1.CreateNodePoolRequest(
)

# Make the request
response = client.create_node_pool(request=request)

# Handle the response
print(response)

# [END container_generated_container_v1_ClusterManager_CreateNodePool_sync]
Loading

0 comments on commit 58cf4aa

Please sign in to comment.