diff --git a/.flake8 b/.flake8
index 20fe9bda..ed931638 100644
--- a/.flake8
+++ b/.flake8
@@ -21,6 +21,8 @@ exclude =
# Exclude generated code.
**/proto/**
**/gapic/**
+ **/services/**
+ **/types/**
*_pb2.py
# Standard linting exemptions.
diff --git a/.gitignore b/.gitignore
index 3fb06e09..b87e1ed5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@
dist
build
eggs
+.eggs
parts
bin
var
@@ -49,6 +50,7 @@ bigquery/docs/generated
# Virtual environment
env/
coverage.xml
+sponge_log.xml
# System test environment variables.
system_tests/local_test_setup
diff --git a/.kokoro/publish-docs.sh b/.kokoro/publish-docs.sh
index ac9f7d8e..d3f611b3 100755
--- a/.kokoro/publish-docs.sh
+++ b/.kokoro/publish-docs.sh
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#!/bin/bash
-
set -eo pipefail
# Disable buffering, so that the logs stream through.
diff --git a/.kokoro/release.sh b/.kokoro/release.sh
index bdc8cf63..fe4cfaaf 100755
--- a/.kokoro/release.sh
+++ b/.kokoro/release.sh
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#!/bin/bash
-
set -eo pipefail
# Start the releasetool reporter
diff --git a/.kokoro/samples/lint/common.cfg b/.kokoro/samples/lint/common.cfg
new file mode 100644
index 00000000..98b7f45a
--- /dev/null
+++ b/.kokoro/samples/lint/common.cfg
@@ -0,0 +1,34 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Build logs will be here
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.xml"
+ }
+}
+
+# Specify which tests to run
+env_vars: {
+ key: "RUN_TESTS_SESSION"
+ value: "lint"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-container/.kokoro/test-samples.sh"
+}
+
+# Configure the docker image for kokoro-trampoline.
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
+}
+
+# Download secrets for samples
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
+
+# Download trampoline resources.
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
+
+# Use the trampoline script to run in docker.
+build_file: "python-container/.kokoro/trampoline.sh"
\ No newline at end of file
diff --git a/.kokoro/samples/lint/continuous.cfg b/.kokoro/samples/lint/continuous.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/lint/continuous.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/lint/periodic.cfg b/.kokoro/samples/lint/periodic.cfg
new file mode 100644
index 00000000..50fec964
--- /dev/null
+++ b/.kokoro/samples/lint/periodic.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "False"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/lint/presubmit.cfg b/.kokoro/samples/lint/presubmit.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/lint/presubmit.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.6/common.cfg b/.kokoro/samples/python3.6/common.cfg
new file mode 100644
index 00000000..f62d4920
--- /dev/null
+++ b/.kokoro/samples/python3.6/common.cfg
@@ -0,0 +1,34 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Build logs will be here
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.xml"
+ }
+}
+
+# Specify which tests to run
+env_vars: {
+ key: "RUN_TESTS_SESSION"
+ value: "py-3.6"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-container/.kokoro/test-samples.sh"
+}
+
+# Configure the docker image for kokoro-trampoline.
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
+}
+
+# Download secrets for samples
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
+
+# Download trampoline resources.
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
+
+# Use the trampoline script to run in docker.
+build_file: "python-container/.kokoro/trampoline.sh"
\ No newline at end of file
diff --git a/.kokoro/samples/python3.6/continuous.cfg b/.kokoro/samples/python3.6/continuous.cfg
new file mode 100644
index 00000000..7218af14
--- /dev/null
+++ b/.kokoro/samples/python3.6/continuous.cfg
@@ -0,0 +1,7 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
+
diff --git a/.kokoro/samples/python3.6/periodic.cfg b/.kokoro/samples/python3.6/periodic.cfg
new file mode 100644
index 00000000..50fec964
--- /dev/null
+++ b/.kokoro/samples/python3.6/periodic.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "False"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.6/presubmit.cfg b/.kokoro/samples/python3.6/presubmit.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/python3.6/presubmit.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg
new file mode 100644
index 00000000..4463d198
--- /dev/null
+++ b/.kokoro/samples/python3.7/common.cfg
@@ -0,0 +1,34 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Build logs will be here
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.xml"
+ }
+}
+
+# Specify which tests to run
+env_vars: {
+ key: "RUN_TESTS_SESSION"
+ value: "py-3.7"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-container/.kokoro/test-samples.sh"
+}
+
+# Configure the docker image for kokoro-trampoline.
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
+}
+
+# Download secrets for samples
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
+
+# Download trampoline resources.
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
+
+# Use the trampoline script to run in docker.
+build_file: "python-container/.kokoro/trampoline.sh"
\ No newline at end of file
diff --git a/.kokoro/samples/python3.7/continuous.cfg b/.kokoro/samples/python3.7/continuous.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/python3.7/continuous.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.7/periodic.cfg b/.kokoro/samples/python3.7/periodic.cfg
new file mode 100644
index 00000000..50fec964
--- /dev/null
+++ b/.kokoro/samples/python3.7/periodic.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "False"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.7/presubmit.cfg b/.kokoro/samples/python3.7/presubmit.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/python3.7/presubmit.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.8/common.cfg b/.kokoro/samples/python3.8/common.cfg
new file mode 100644
index 00000000..77b79cba
--- /dev/null
+++ b/.kokoro/samples/python3.8/common.cfg
@@ -0,0 +1,34 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Build logs will be here
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.xml"
+ }
+}
+
+# Specify which tests to run
+env_vars: {
+ key: "RUN_TESTS_SESSION"
+ value: "py-3.8"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-container/.kokoro/test-samples.sh"
+}
+
+# Configure the docker image for kokoro-trampoline.
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
+}
+
+# Download secrets for samples
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
+
+# Download trampoline resources.
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
+
+# Use the trampoline script to run in docker.
+build_file: "python-container/.kokoro/trampoline.sh"
\ No newline at end of file
diff --git a/.kokoro/samples/python3.8/continuous.cfg b/.kokoro/samples/python3.8/continuous.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/python3.8/continuous.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.8/periodic.cfg b/.kokoro/samples/python3.8/periodic.cfg
new file mode 100644
index 00000000..50fec964
--- /dev/null
+++ b/.kokoro/samples/python3.8/periodic.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "False"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.8/presubmit.cfg b/.kokoro/samples/python3.8/presubmit.cfg
new file mode 100644
index 00000000..a1c8d975
--- /dev/null
+++ b/.kokoro/samples/python3.8/presubmit.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/test-samples.sh b/.kokoro/test-samples.sh
new file mode 100755
index 00000000..b8cb9cbc
--- /dev/null
+++ b/.kokoro/test-samples.sh
@@ -0,0 +1,104 @@
+#!/bin/bash
+# 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
+#
+# https://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.
+
+
+# `-e` enables the script to automatically fail when a command fails
+# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
+set -eo pipefail
+# Enables `**` to include files nested inside sub-folders
+shopt -s globstar
+
+cd github/python-container
+
+# Run periodic samples tests at latest release
+if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
+ LATEST_RELEASE=$(git describe --abbrev=0 --tags)
+ git checkout $LATEST_RELEASE
+fi
+
+# Disable buffering, so that the logs stream through.
+export PYTHONUNBUFFERED=1
+
+# Debug: show build environment
+env | grep KOKORO
+
+# Install nox
+python3.6 -m pip install --upgrade --quiet nox
+
+# Use secrets acessor service account to get secrets
+if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
+ gcloud auth activate-service-account \
+ --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
+ --project="cloud-devrel-kokoro-resources"
+fi
+
+# This script will create 3 files:
+# - testing/test-env.sh
+# - testing/service-account.json
+# - testing/client-secrets.json
+./scripts/decrypt-secrets.sh
+
+source ./testing/test-env.sh
+export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json
+
+# For cloud-run session, we activate the service account for gcloud sdk.
+gcloud auth activate-service-account \
+ --key-file "${GOOGLE_APPLICATION_CREDENTIALS}"
+
+export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json
+
+echo -e "\n******************** TESTING PROJECTS ********************"
+
+# Switch to 'fail at end' to allow all tests to complete before exiting.
+set +e
+# Use RTN to return a non-zero value if the test fails.
+RTN=0
+ROOT=$(pwd)
+# Find all requirements.txt in the samples directory (may break on whitespace).
+for file in samples/**/requirements.txt; do
+ cd "$ROOT"
+ # Navigate to the project folder.
+ file=$(dirname "$file")
+ cd "$file"
+
+ echo "------------------------------------------------------------"
+ echo "- testing $file"
+ echo "------------------------------------------------------------"
+
+ # Use nox to execute the tests for the project.
+ python3.6 -m nox -s "$RUN_TESTS_SESSION"
+ EXIT=$?
+
+ # If this is a periodic build, send the test log to the Build Cop Bot.
+ # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
+ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
+ chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
+ $KOKORO_GFILE_DIR/linux_amd64/buildcop
+ fi
+
+ if [[ $EXIT -ne 0 ]]; then
+ RTN=1
+ echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
+ else
+ echo -e "\n Testing completed.\n"
+ fi
+
+done
+cd "$ROOT"
+
+# Workaround for Kokoro permissions issue: delete secrets
+rm testing/{test-env.sh,client-secrets.json,service-account.json}
+
+exit "$RTN"
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e02bd2f4..881ec237 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,17 @@
[1]: https://pypi.org/project/google-cloud-container/#history
+## [2.0.0](https://www.github.com/googleapis/python-container/compare/v1.0.1...v2.0.0) (2020-07-16)
+
+
+### ⚠ BREAKING CHANGES
+
+* migrate to microgenerator (#33)
+
+### Features
+
+* migrate to microgenerator ([#33](https://www.github.com/googleapis/python-container/issues/33)) ([aa9b20c](https://www.github.com/googleapis/python-container/commit/aa9b20c6f4ccb6dff305bfcd72e1bde4a1ee86cd))
+
### [1.0.1](https://www.github.com/googleapis/python-container/compare/v1.0.0...v1.0.1) (2020-06-16)
diff --git a/MANIFEST.in b/MANIFEST.in
index 68855abc..e9e29d12 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -20,3 +20,6 @@ recursive-include google *.json *.proto
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__
+
+# Exclude scripts for samples readmegen
+prune scripts/readme-gen
\ No newline at end of file
diff --git a/README.rst b/README.rst
index 32e4dc55..ca7011cd 100644
--- a/README.rst
+++ b/README.rst
@@ -1,7 +1,7 @@
Python Client for Google Kubernetes Engine API
==============================================
-|ga| |pypi| |versions|
+|ga| |pypi| |versions|
`Google Kubernetes Engine API`_: The Google Kubernetes Engine API is used for
building and managing container based applications, powered by the open source
@@ -49,11 +49,13 @@ dependencies.
Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
-Python >= 3.5
+Python >= 3.6
Deprecated Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python == 2.7.
+
+The last version of this library compatible with Python 2.7 is google-cloud-container==1.0.1
Mac/Linux
diff --git a/UPGRADING.md b/UPGRADING.md
new file mode 100644
index 00000000..b96d89ff
--- /dev/null
+++ b/UPGRADING.md
@@ -0,0 +1,154 @@
+# 2.0.0 Migration Guide
+
+The 2.0 release of the `google-cloud-container` client is a significant upgrade based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-python), and includes substantial interface changes. Existing code written for earlier versions of this library will likely require updates to use this version. This document describes the changes that have been made, and what you need to do to update your usage.
+
+If you experience issues or have questions, please file an [issue](https://github.com/googleapis/python-container/issues).
+
+## Supported Python Versions
+
+> **WARNING**: Breaking change
+
+The 2.0.0 release requires Python 3.6+.
+
+
+## Method Calls
+
+> **WARNING**: Breaking change
+
+Methods expect request objects. We provide a script that will convert most common use cases.
+
+* Install the library
+
+```py
+python3 -m pip install google-cloud-container
+```
+
+* The script `fixup_container_v1_keywords.py` and `fixup_container_v1beta1_keywords.py`
+are shipped with the library. It expects an input directory (with the code to convert) and an empty destination directory.
+
+```sh
+$ fixup_container_v1_keywords.py --input-directory .samples/ --output-directory samples/
+```
+
+**Before:**
+```py
+from google.cloud import container_v1
+
+client = container_v1.ClusterManagerClient()
+
+clusters = client.list_clusters(
+ project_id="project_id", zone="us-central1-a", parent="parent"
+)
+```
+
+
+**After:**
+```py
+from google.cloud import container_v1
+
+client = container_v1.ClusterManagerClient()
+
+clusters = client.list_clusters(
+ request = {'project_id': "project_id", 'zone': "us-central1-a", 'parent': "parent"}
+)
+```
+
+### More Details
+
+In `google-cloud-container<2.0.0`, parameters required by the API were positional parameters and optional parameters were keyword parameters.
+
+**Before:**
+```py
+ def list_clusters(
+ self,
+ project_id=None,
+ zone=None,
+ parent=None,
+ retry=google.api_core.gapic_v1.method.DEFAULT,
+ timeout=google.api_core.gapic_v1.method.DEFAULT,
+ metadata=None,
+ ):
+```
+
+In the 2.0.0 release, all methods have a single positional parameter `request`. Method docstrings indicate whether a parameter is required or optional.
+
+Some methods have additional keyword only parameters. The available parameters depend on the [`google.api.method_signature` annotation](https://github.com/googleapis/googleapis/blob/master/google/container/v1/cluster_service.proto#L48) specified by the API producer.
+
+
+**After:**
+```py
+ def list_clusters(
+ self,
+ request: cluster_service.ListClustersRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListClustersResponse:
+```
+
+> **NOTE:** The `request` parameter and flattened keyword parameters for the API are mutually exclusive.
+> Passing both will result in an error.
+
+
+Both of these calls are valid:
+
+```py
+response = client.list_clusters(
+ request={
+ "project_id": project_id,
+ "zone": zone,
+ "parent": parent,
+ }
+)
+```
+
+```py
+response = client.list_clusters(
+ project_id=project_id,
+ zone=zone,
+ parent=parent,
+)
+```
+
+This call is invalid because it mixes `request` with a keyword argument `parent`. Executing this code will result in an error.
+
+```py
+response = client.list_clusters(
+ request={
+ "project_id": project_id,
+ "zone": zone,
+ },
+ parent=parent
+)
+```
+
+
+
+## Enums and Types
+
+
+> **WARNING**: Breaking change
+
+The submodules `enums` and `types` have been removed.
+
+**Before:**
+```py
+
+from google.cloud import container
+
+status = container.enums.Cluster.Status.RUNNING
+cluster = container.types.Cluster(name="name")
+```
+
+
+**After:**
+```py
+from google.cloud import container
+
+status = container.Cluster.Status.RUNNING
+cluster = container.Cluster(name="name")
+```
diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md
new file mode 120000
index 00000000..01097c8c
--- /dev/null
+++ b/docs/UPGRADING.md
@@ -0,0 +1 @@
+../UPGRADING.md
\ No newline at end of file
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index 228529ef..6316a537 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -21,8 +21,8 @@
- On January 1, 2020 this library will no longer support Python 2 on the latest released version.
- Previously released library versions will continue to be available. For more information please
+ As of January 1, 2020 this library no longer supports Python 2 on the latest released version.
+ Library versions released prior to that date will continue to be available. For more information please
visit
Python 2 support on Google Cloud.
{% block body %} {% endblock %}
diff --git a/docs/conf.py b/docs/conf.py
index 91b79c42..e971bae7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -38,21 +38,18 @@
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
+ "recommonmark",
]
# autodoc/autosummary flags
autoclass_content = "both"
-autodoc_default_flags = ["members"]
+autodoc_default_options = {"members": True}
autosummary_generate = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
-# Allow markdown includes (so releases.md can include CHANGLEOG.md)
-# http://www.sphinx-doc.org/en/master/markdown.html
-source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
-
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
@@ -340,7 +337,7 @@
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
- "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None),
+ "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"grpc": ("https://grpc.io/grpc/python/", None),
}
diff --git a/docs/container_v1/services.rst b/docs/container_v1/services.rst
new file mode 100644
index 00000000..a23224df
--- /dev/null
+++ b/docs/container_v1/services.rst
@@ -0,0 +1,6 @@
+Services for Google Container v1 API
+====================================
+
+.. automodule:: google.cloud.container_v1.services.cluster_manager
+ :members:
+ :inherited-members:
diff --git a/docs/container_v1/types.rst b/docs/container_v1/types.rst
new file mode 100644
index 00000000..6b9225d6
--- /dev/null
+++ b/docs/container_v1/types.rst
@@ -0,0 +1,5 @@
+Types for Google Container v1 API
+=================================
+
+.. automodule:: google.cloud.container_v1.types
+ :members:
diff --git a/docs/container_v1beta1/services.rst b/docs/container_v1beta1/services.rst
new file mode 100644
index 00000000..e4b6a994
--- /dev/null
+++ b/docs/container_v1beta1/services.rst
@@ -0,0 +1,6 @@
+Services for Google Container v1beta1 API
+=========================================
+
+.. automodule:: google.cloud.container_v1beta1.services.cluster_manager
+ :members:
+ :inherited-members:
diff --git a/docs/container_v1beta1/types.rst b/docs/container_v1beta1/types.rst
new file mode 100644
index 00000000..8c258957
--- /dev/null
+++ b/docs/container_v1beta1/types.rst
@@ -0,0 +1,5 @@
+Types for Google Container v1beta1 API
+======================================
+
+.. automodule:: google.cloud.container_v1beta1.types
+ :members:
diff --git a/docs/gapic/v1/api.rst b/docs/gapic/v1/api.rst
deleted file mode 100644
index 62435f64..00000000
--- a/docs/gapic/v1/api.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Client for Google Container Engine API
-======================================
-
-.. automodule:: google.cloud.container_v1
- :members:
- :inherited-members:
\ No newline at end of file
diff --git a/docs/gapic/v1/types.rst b/docs/gapic/v1/types.rst
deleted file mode 100644
index 7b1c1f95..00000000
--- a/docs/gapic/v1/types.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-Types for Google Container Engine API Client
-============================================
-
-.. automodule:: google.cloud.container_v1.types
- :members:
\ No newline at end of file
diff --git a/docs/index.rst b/docs/index.rst
index 9b788c6c..b3f611dd 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,12 +1,36 @@
.. include:: README.rst
+.. include:: multiprocessing.rst
+
API Reference
-------------
+
+v1
+-------------
.. toctree::
- :maxdepth: 2
+ :maxdepth: 2
+
+ container_v1/services
+ container_v1/types
+
+v1beta1
+-------------
+.. toctree::
+ :maxdepth: 2
+
+ container_v1beta1/services
+ container_v1beta1/types
+
+Migration Guide
+---------------
+
+See the guide below for instructions on migrating to the 2.x release of this library.
+
+.. toctree::
+ :maxdepth: 2
+
+ UPGRADING
- gapic/v1/api
- gapic/v1/types
Changelog
---------
diff --git a/docs/multiprocessing.rst b/docs/multiprocessing.rst
new file mode 100644
index 00000000..1cb29d4c
--- /dev/null
+++ b/docs/multiprocessing.rst
@@ -0,0 +1,7 @@
+.. note::
+
+ Because this client uses :mod:`grpcio` library, it is safe to
+ share instances across threads. In multiprocessing scenarios, the best
+ practice is to create client instances *after* the invocation of
+ :func:`os.fork` by :class:`multiprocessing.Pool` or
+ :class:`multiprocessing.Process`.
diff --git a/google/__init__.py b/google/__init__.py
deleted file mode 100644
index 2f4b4738..00000000
--- a/google/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-try:
- import pkg_resources
-
- pkg_resources.declare_namespace(__name__)
-except ImportError:
- import pkgutil
-
- __path__ = pkgutil.extend_path(__path__, __name__)
diff --git a/google/cloud/__init__.py b/google/cloud/__init__.py
deleted file mode 100644
index 2f4b4738..00000000
--- a/google/cloud/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-try:
- import pkg_resources
-
- pkg_resources.declare_namespace(__name__)
-except ImportError:
- import pkgutil
-
- __path__ = pkgutil.extend_path(__path__, __name__)
diff --git a/google/cloud/container/__init__.py b/google/cloud/container/__init__.py
new file mode 100644
index 00000000..216ce9b3
--- /dev/null
+++ b/google/cloud/container/__init__.py
@@ -0,0 +1,198 @@
+# -*- 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.
+#
+
+from google.cloud.container_v1.services.cluster_manager.async_client import (
+ ClusterManagerAsyncClient,
+)
+from google.cloud.container_v1.services.cluster_manager.client import (
+ ClusterManagerClient,
+)
+from google.cloud.container_v1.types.cluster_service import AcceleratorConfig
+from google.cloud.container_v1.types.cluster_service import AddonsConfig
+from google.cloud.container_v1.types.cluster_service import AuthenticatorGroupsConfig
+from google.cloud.container_v1.types.cluster_service import AutoUpgradeOptions
+from google.cloud.container_v1.types.cluster_service import (
+ AutoprovisioningNodePoolDefaults,
+)
+from google.cloud.container_v1.types.cluster_service import BinaryAuthorization
+from google.cloud.container_v1.types.cluster_service import CancelOperationRequest
+from google.cloud.container_v1.types.cluster_service import ClientCertificateConfig
+from google.cloud.container_v1.types.cluster_service import CloudRunConfig
+from google.cloud.container_v1.types.cluster_service import Cluster
+from google.cloud.container_v1.types.cluster_service import ClusterAutoscaling
+from google.cloud.container_v1.types.cluster_service import ClusterUpdate
+from google.cloud.container_v1.types.cluster_service import CompleteIPRotationRequest
+from google.cloud.container_v1.types.cluster_service import CreateClusterRequest
+from google.cloud.container_v1.types.cluster_service import CreateNodePoolRequest
+from google.cloud.container_v1.types.cluster_service import DailyMaintenanceWindow
+from google.cloud.container_v1.types.cluster_service import DatabaseEncryption
+from google.cloud.container_v1.types.cluster_service import DeleteClusterRequest
+from google.cloud.container_v1.types.cluster_service import DeleteNodePoolRequest
+from google.cloud.container_v1.types.cluster_service import GetClusterRequest
+from google.cloud.container_v1.types.cluster_service import GetNodePoolRequest
+from google.cloud.container_v1.types.cluster_service import GetOperationRequest
+from google.cloud.container_v1.types.cluster_service import GetServerConfigRequest
+from google.cloud.container_v1.types.cluster_service import HorizontalPodAutoscaling
+from google.cloud.container_v1.types.cluster_service import HttpLoadBalancing
+from google.cloud.container_v1.types.cluster_service import IPAllocationPolicy
+from google.cloud.container_v1.types.cluster_service import IntraNodeVisibilityConfig
+from google.cloud.container_v1.types.cluster_service import KubernetesDashboard
+from google.cloud.container_v1.types.cluster_service import LegacyAbac
+from google.cloud.container_v1.types.cluster_service import ListClustersRequest
+from google.cloud.container_v1.types.cluster_service import ListClustersResponse
+from google.cloud.container_v1.types.cluster_service import ListNodePoolsRequest
+from google.cloud.container_v1.types.cluster_service import ListNodePoolsResponse
+from google.cloud.container_v1.types.cluster_service import ListOperationsRequest
+from google.cloud.container_v1.types.cluster_service import ListOperationsResponse
+from google.cloud.container_v1.types.cluster_service import ListUsableSubnetworksRequest
+from google.cloud.container_v1.types.cluster_service import (
+ ListUsableSubnetworksResponse,
+)
+from google.cloud.container_v1.types.cluster_service import MaintenancePolicy
+from google.cloud.container_v1.types.cluster_service import MaintenanceWindow
+from google.cloud.container_v1.types.cluster_service import MasterAuth
+from google.cloud.container_v1.types.cluster_service import (
+ MasterAuthorizedNetworksConfig,
+)
+from google.cloud.container_v1.types.cluster_service import MaxPodsConstraint
+from google.cloud.container_v1.types.cluster_service import NetworkConfig
+from google.cloud.container_v1.types.cluster_service import NetworkPolicy
+from google.cloud.container_v1.types.cluster_service import NetworkPolicyConfig
+from google.cloud.container_v1.types.cluster_service import NodeConfig
+from google.cloud.container_v1.types.cluster_service import NodeManagement
+from google.cloud.container_v1.types.cluster_service import NodePool
+from google.cloud.container_v1.types.cluster_service import NodePoolAutoscaling
+from google.cloud.container_v1.types.cluster_service import NodeTaint
+from google.cloud.container_v1.types.cluster_service import Operation
+from google.cloud.container_v1.types.cluster_service import PrivateClusterConfig
+from google.cloud.container_v1.types.cluster_service import RecurringTimeWindow
+from google.cloud.container_v1.types.cluster_service import ResourceLimit
+from google.cloud.container_v1.types.cluster_service import ResourceUsageExportConfig
+from google.cloud.container_v1.types.cluster_service import (
+ RollbackNodePoolUpgradeRequest,
+)
+from google.cloud.container_v1.types.cluster_service import ServerConfig
+from google.cloud.container_v1.types.cluster_service import SetAddonsConfigRequest
+from google.cloud.container_v1.types.cluster_service import SetLabelsRequest
+from google.cloud.container_v1.types.cluster_service import SetLegacyAbacRequest
+from google.cloud.container_v1.types.cluster_service import SetLocationsRequest
+from google.cloud.container_v1.types.cluster_service import SetLoggingServiceRequest
+from google.cloud.container_v1.types.cluster_service import SetMaintenancePolicyRequest
+from google.cloud.container_v1.types.cluster_service import SetMasterAuthRequest
+from google.cloud.container_v1.types.cluster_service import SetMonitoringServiceRequest
+from google.cloud.container_v1.types.cluster_service import SetNetworkPolicyRequest
+from google.cloud.container_v1.types.cluster_service import (
+ SetNodePoolAutoscalingRequest,
+)
+from google.cloud.container_v1.types.cluster_service import SetNodePoolManagementRequest
+from google.cloud.container_v1.types.cluster_service import SetNodePoolSizeRequest
+from google.cloud.container_v1.types.cluster_service import ShieldedInstanceConfig
+from google.cloud.container_v1.types.cluster_service import StartIPRotationRequest
+from google.cloud.container_v1.types.cluster_service import StatusCondition
+from google.cloud.container_v1.types.cluster_service import TimeWindow
+from google.cloud.container_v1.types.cluster_service import UpdateClusterRequest
+from google.cloud.container_v1.types.cluster_service import UpdateMasterRequest
+from google.cloud.container_v1.types.cluster_service import UpdateNodePoolRequest
+from google.cloud.container_v1.types.cluster_service import UsableSubnetwork
+from google.cloud.container_v1.types.cluster_service import (
+ UsableSubnetworkSecondaryRange,
+)
+from google.cloud.container_v1.types.cluster_service import VerticalPodAutoscaling
+
+__all__ = (
+ "AcceleratorConfig",
+ "AddonsConfig",
+ "AuthenticatorGroupsConfig",
+ "AutoUpgradeOptions",
+ "AutoprovisioningNodePoolDefaults",
+ "BinaryAuthorization",
+ "CancelOperationRequest",
+ "ClientCertificateConfig",
+ "CloudRunConfig",
+ "Cluster",
+ "ClusterAutoscaling",
+ "ClusterManagerAsyncClient",
+ "ClusterManagerClient",
+ "ClusterUpdate",
+ "CompleteIPRotationRequest",
+ "CreateClusterRequest",
+ "CreateNodePoolRequest",
+ "DailyMaintenanceWindow",
+ "DatabaseEncryption",
+ "DeleteClusterRequest",
+ "DeleteNodePoolRequest",
+ "GetClusterRequest",
+ "GetNodePoolRequest",
+ "GetOperationRequest",
+ "GetServerConfigRequest",
+ "HorizontalPodAutoscaling",
+ "HttpLoadBalancing",
+ "IPAllocationPolicy",
+ "IntraNodeVisibilityConfig",
+ "KubernetesDashboard",
+ "LegacyAbac",
+ "ListClustersRequest",
+ "ListClustersResponse",
+ "ListNodePoolsRequest",
+ "ListNodePoolsResponse",
+ "ListOperationsRequest",
+ "ListOperationsResponse",
+ "ListUsableSubnetworksRequest",
+ "ListUsableSubnetworksResponse",
+ "MaintenancePolicy",
+ "MaintenanceWindow",
+ "MasterAuth",
+ "MasterAuthorizedNetworksConfig",
+ "MaxPodsConstraint",
+ "NetworkConfig",
+ "NetworkPolicy",
+ "NetworkPolicyConfig",
+ "NodeConfig",
+ "NodeManagement",
+ "NodePool",
+ "NodePoolAutoscaling",
+ "NodeTaint",
+ "Operation",
+ "PrivateClusterConfig",
+ "RecurringTimeWindow",
+ "ResourceLimit",
+ "ResourceUsageExportConfig",
+ "RollbackNodePoolUpgradeRequest",
+ "ServerConfig",
+ "SetAddonsConfigRequest",
+ "SetLabelsRequest",
+ "SetLegacyAbacRequest",
+ "SetLocationsRequest",
+ "SetLoggingServiceRequest",
+ "SetMaintenancePolicyRequest",
+ "SetMasterAuthRequest",
+ "SetMonitoringServiceRequest",
+ "SetNetworkPolicyRequest",
+ "SetNodePoolAutoscalingRequest",
+ "SetNodePoolManagementRequest",
+ "SetNodePoolSizeRequest",
+ "ShieldedInstanceConfig",
+ "StartIPRotationRequest",
+ "StatusCondition",
+ "TimeWindow",
+ "UpdateClusterRequest",
+ "UpdateMasterRequest",
+ "UpdateNodePoolRequest",
+ "UsableSubnetwork",
+ "UsableSubnetworkSecondaryRange",
+ "VerticalPodAutoscaling",
+)
diff --git a/google/cloud/container/py.typed b/google/cloud/container/py.typed
new file mode 100644
index 00000000..fd835114
--- /dev/null
+++ b/google/cloud/container/py.typed
@@ -0,0 +1,2 @@
+# Marker file for PEP 561.
+# The google-container package uses inline types.
diff --git a/google/cloud/container_v1/__init__.py b/google/cloud/container_v1/__init__.py
index ffb8fd72..1c3fbcab 100644
--- a/google/cloud/container_v1/__init__.py
+++ b/google/cloud/container_v1/__init__.py
@@ -1,41 +1,181 @@
# -*- 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
#
-# https://www.apache.org/licenses/LICENSE-2.0
+# 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 absolute_import
-import sys
-import warnings
-
-from google.cloud.container_v1 import types
-from google.cloud.container_v1.gapic import cluster_manager_client
-from google.cloud.container_v1.gapic import enums
-
-
-if sys.version_info[:2] == (2, 7):
- message = (
- "A future version of this library will drop support for Python 2.7."
- "More details about Python 2 support for Google Cloud Client Libraries"
- "can be found at https://cloud.google.com/python/docs/python2-sunset/"
- )
- warnings.warn(message, DeprecationWarning)
-
-
-class ClusterManagerClient(cluster_manager_client.ClusterManagerClient):
- __doc__ = cluster_manager_client.ClusterManagerClient.__doc__
- enums = enums
+from .services.cluster_manager import ClusterManagerClient
+from .types.cluster_service import AcceleratorConfig
+from .types.cluster_service import AddonsConfig
+from .types.cluster_service import AuthenticatorGroupsConfig
+from .types.cluster_service import AutoUpgradeOptions
+from .types.cluster_service import AutoprovisioningNodePoolDefaults
+from .types.cluster_service import BinaryAuthorization
+from .types.cluster_service import CancelOperationRequest
+from .types.cluster_service import ClientCertificateConfig
+from .types.cluster_service import CloudRunConfig
+from .types.cluster_service import Cluster
+from .types.cluster_service import ClusterAutoscaling
+from .types.cluster_service import ClusterUpdate
+from .types.cluster_service import CompleteIPRotationRequest
+from .types.cluster_service import CreateClusterRequest
+from .types.cluster_service import CreateNodePoolRequest
+from .types.cluster_service import DailyMaintenanceWindow
+from .types.cluster_service import DatabaseEncryption
+from .types.cluster_service import DeleteClusterRequest
+from .types.cluster_service import DeleteNodePoolRequest
+from .types.cluster_service import GetClusterRequest
+from .types.cluster_service import GetNodePoolRequest
+from .types.cluster_service import GetOperationRequest
+from .types.cluster_service import GetServerConfigRequest
+from .types.cluster_service import HorizontalPodAutoscaling
+from .types.cluster_service import HttpLoadBalancing
+from .types.cluster_service import IPAllocationPolicy
+from .types.cluster_service import IntraNodeVisibilityConfig
+from .types.cluster_service import KubernetesDashboard
+from .types.cluster_service import LegacyAbac
+from .types.cluster_service import ListClustersRequest
+from .types.cluster_service import ListClustersResponse
+from .types.cluster_service import ListNodePoolsRequest
+from .types.cluster_service import ListNodePoolsResponse
+from .types.cluster_service import ListOperationsRequest
+from .types.cluster_service import ListOperationsResponse
+from .types.cluster_service import ListUsableSubnetworksRequest
+from .types.cluster_service import ListUsableSubnetworksResponse
+from .types.cluster_service import MaintenancePolicy
+from .types.cluster_service import MaintenanceWindow
+from .types.cluster_service import MasterAuth
+from .types.cluster_service import MasterAuthorizedNetworksConfig
+from .types.cluster_service import MaxPodsConstraint
+from .types.cluster_service import NetworkConfig
+from .types.cluster_service import NetworkPolicy
+from .types.cluster_service import NetworkPolicyConfig
+from .types.cluster_service import NodeConfig
+from .types.cluster_service import NodeManagement
+from .types.cluster_service import NodePool
+from .types.cluster_service import NodePoolAutoscaling
+from .types.cluster_service import NodeTaint
+from .types.cluster_service import Operation
+from .types.cluster_service import PrivateClusterConfig
+from .types.cluster_service import RecurringTimeWindow
+from .types.cluster_service import ResourceLimit
+from .types.cluster_service import ResourceUsageExportConfig
+from .types.cluster_service import RollbackNodePoolUpgradeRequest
+from .types.cluster_service import ServerConfig
+from .types.cluster_service import SetAddonsConfigRequest
+from .types.cluster_service import SetLabelsRequest
+from .types.cluster_service import SetLegacyAbacRequest
+from .types.cluster_service import SetLocationsRequest
+from .types.cluster_service import SetLoggingServiceRequest
+from .types.cluster_service import SetMaintenancePolicyRequest
+from .types.cluster_service import SetMasterAuthRequest
+from .types.cluster_service import SetMonitoringServiceRequest
+from .types.cluster_service import SetNetworkPolicyRequest
+from .types.cluster_service import SetNodePoolAutoscalingRequest
+from .types.cluster_service import SetNodePoolManagementRequest
+from .types.cluster_service import SetNodePoolSizeRequest
+from .types.cluster_service import ShieldedInstanceConfig
+from .types.cluster_service import StartIPRotationRequest
+from .types.cluster_service import StatusCondition
+from .types.cluster_service import TimeWindow
+from .types.cluster_service import UpdateClusterRequest
+from .types.cluster_service import UpdateMasterRequest
+from .types.cluster_service import UpdateNodePoolRequest
+from .types.cluster_service import UsableSubnetwork
+from .types.cluster_service import UsableSubnetworkSecondaryRange
+from .types.cluster_service import VerticalPodAutoscaling
-__all__ = ("enums", "types", "ClusterManagerClient")
+__all__ = (
+ "AcceleratorConfig",
+ "AddonsConfig",
+ "AuthenticatorGroupsConfig",
+ "AutoUpgradeOptions",
+ "AutoprovisioningNodePoolDefaults",
+ "BinaryAuthorization",
+ "CancelOperationRequest",
+ "ClientCertificateConfig",
+ "CloudRunConfig",
+ "Cluster",
+ "ClusterAutoscaling",
+ "ClusterUpdate",
+ "CompleteIPRotationRequest",
+ "CreateClusterRequest",
+ "CreateNodePoolRequest",
+ "DailyMaintenanceWindow",
+ "DatabaseEncryption",
+ "DeleteClusterRequest",
+ "DeleteNodePoolRequest",
+ "GetClusterRequest",
+ "GetNodePoolRequest",
+ "GetOperationRequest",
+ "GetServerConfigRequest",
+ "HorizontalPodAutoscaling",
+ "HttpLoadBalancing",
+ "IPAllocationPolicy",
+ "IntraNodeVisibilityConfig",
+ "KubernetesDashboard",
+ "LegacyAbac",
+ "ListClustersRequest",
+ "ListClustersResponse",
+ "ListNodePoolsRequest",
+ "ListNodePoolsResponse",
+ "ListOperationsRequest",
+ "ListOperationsResponse",
+ "ListUsableSubnetworksRequest",
+ "ListUsableSubnetworksResponse",
+ "MaintenancePolicy",
+ "MaintenanceWindow",
+ "MasterAuth",
+ "MasterAuthorizedNetworksConfig",
+ "MaxPodsConstraint",
+ "NetworkConfig",
+ "NetworkPolicy",
+ "NetworkPolicyConfig",
+ "NodeConfig",
+ "NodeManagement",
+ "NodePool",
+ "NodePoolAutoscaling",
+ "NodeTaint",
+ "Operation",
+ "PrivateClusterConfig",
+ "RecurringTimeWindow",
+ "ResourceLimit",
+ "ResourceUsageExportConfig",
+ "RollbackNodePoolUpgradeRequest",
+ "ServerConfig",
+ "SetAddonsConfigRequest",
+ "SetLabelsRequest",
+ "SetLegacyAbacRequest",
+ "SetLocationsRequest",
+ "SetLoggingServiceRequest",
+ "SetMaintenancePolicyRequest",
+ "SetMasterAuthRequest",
+ "SetMonitoringServiceRequest",
+ "SetNetworkPolicyRequest",
+ "SetNodePoolAutoscalingRequest",
+ "SetNodePoolManagementRequest",
+ "SetNodePoolSizeRequest",
+ "ShieldedInstanceConfig",
+ "StartIPRotationRequest",
+ "StatusCondition",
+ "TimeWindow",
+ "UpdateClusterRequest",
+ "UpdateMasterRequest",
+ "UpdateNodePoolRequest",
+ "UsableSubnetwork",
+ "UsableSubnetworkSecondaryRange",
+ "VerticalPodAutoscaling",
+ "ClusterManagerClient",
+)
diff --git a/google/cloud/container_v1/gapic/cluster_manager_client.py b/google/cloud/container_v1/gapic/cluster_manager_client.py
deleted file mode 100644
index 3027453f..00000000
--- a/google/cloud/container_v1/gapic/cluster_manager_client.py
+++ /dev/null
@@ -1,3060 +0,0 @@
-# -*- 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
-#
-# https://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.
-
-"""Accesses the google.container.v1 ClusterManager API."""
-
-import functools
-import pkg_resources
-import warnings
-
-from google.oauth2 import service_account
-import google.api_core.client_options
-import google.api_core.gapic_v1.client_info
-import google.api_core.gapic_v1.config
-import google.api_core.gapic_v1.method
-import google.api_core.gapic_v1.routing_header
-import google.api_core.grpc_helpers
-import google.api_core.page_iterator
-import grpc
-
-from google.cloud.container_v1.gapic import cluster_manager_client_config
-from google.cloud.container_v1.gapic import enums
-from google.cloud.container_v1.gapic.transports import cluster_manager_grpc_transport
-from google.cloud.container_v1.proto import cluster_service_pb2
-from google.cloud.container_v1.proto import cluster_service_pb2_grpc
-from google.protobuf import empty_pb2
-
-
-_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
- "google-cloud-container"
-).version
-
-
-class ClusterManagerClient(object):
- """Google Kubernetes Engine Cluster Manager v1"""
-
- SERVICE_ADDRESS = "container.googleapis.com:443"
- """The default address of the service."""
-
- # The name of the interface for this client. This is the key used to
- # find the method configuration in the client_config dictionary.
- _INTERFACE_NAME = "google.container.v1.ClusterManager"
-
- @classmethod
- def from_service_account_file(cls, filename, *args, **kwargs):
- """Creates an instance of this client using the provided credentials
- file.
-
- Args:
- filename (str): The path to the service account private key json
- file.
- args: Additional arguments to pass to the constructor.
- kwargs: Additional arguments to pass to the constructor.
-
- Returns:
- ClusterManagerClient: The constructed client.
- """
- credentials = service_account.Credentials.from_service_account_file(filename)
- kwargs["credentials"] = credentials
- return cls(*args, **kwargs)
-
- from_service_account_json = from_service_account_file
-
- def __init__(
- self,
- transport=None,
- channel=None,
- credentials=None,
- client_config=None,
- client_info=None,
- client_options=None,
- ):
- """Constructor.
-
- Args:
- transport (Union[~.ClusterManagerGrpcTransport,
- Callable[[~.Credentials, type], ~.ClusterManagerGrpcTransport]): A transport
- instance, responsible for actually making the API calls.
- The default transport uses the gRPC protocol.
- This argument may also be a callable which returns a
- transport instance. Callables will be sent the credentials
- as the first argument and the default transport class as
- the second argument.
- channel (grpc.Channel): DEPRECATED. A ``Channel`` instance
- through which to make calls. This argument is mutually exclusive
- with ``credentials``; providing both will raise an exception.
- credentials (google.auth.credentials.Credentials): The
- authorization credentials to attach to requests. These
- credentials identify this application to the service. If none
- are specified, the client will attempt to ascertain the
- credentials from the environment.
- This argument is mutually exclusive with providing a
- transport instance to ``transport``; doing so will raise
- an exception.
- client_config (dict): DEPRECATED. A dictionary of call options for
- each method. If not specified, the default configuration is used.
- client_info (google.api_core.gapic_v1.client_info.ClientInfo):
- The client info used to send a user-agent string along with
- API requests. If ``None``, then default info will be used.
- Generally, you only need to set this if you're developing
- your own client library.
- client_options (Union[dict, google.api_core.client_options.ClientOptions]):
- Client options used to set user options on the client. API Endpoint
- should be set through client_options.
- """
- # Raise deprecation warnings for things we want to go away.
- if client_config is not None:
- warnings.warn(
- "The `client_config` argument is deprecated.",
- PendingDeprecationWarning,
- stacklevel=2,
- )
- else:
- client_config = cluster_manager_client_config.config
-
- if channel:
- warnings.warn(
- "The `channel` argument is deprecated; use " "`transport` instead.",
- PendingDeprecationWarning,
- stacklevel=2,
- )
-
- api_endpoint = self.SERVICE_ADDRESS
- if client_options:
- if type(client_options) == dict:
- client_options = google.api_core.client_options.from_dict(
- client_options
- )
- if client_options.api_endpoint:
- api_endpoint = client_options.api_endpoint
-
- # Instantiate the transport.
- # The transport is responsible for handling serialization and
- # deserialization and actually sending data to the service.
- if transport:
- if callable(transport):
- self.transport = transport(
- credentials=credentials,
- default_class=cluster_manager_grpc_transport.ClusterManagerGrpcTransport,
- address=api_endpoint,
- )
- else:
- if credentials:
- raise ValueError(
- "Received both a transport instance and "
- "credentials; these are mutually exclusive."
- )
- self.transport = transport
- else:
- self.transport = cluster_manager_grpc_transport.ClusterManagerGrpcTransport(
- address=api_endpoint, channel=channel, credentials=credentials
- )
-
- if client_info is None:
- client_info = google.api_core.gapic_v1.client_info.ClientInfo(
- gapic_version=_GAPIC_LIBRARY_VERSION
- )
- else:
- client_info.gapic_version = _GAPIC_LIBRARY_VERSION
- self._client_info = client_info
-
- # Parse out the default settings for retry and timeout for each RPC
- # from the client configuration.
- # (Ordinarily, these are the defaults specified in the `*_config.py`
- # file next to this one.)
- self._method_configs = google.api_core.gapic_v1.config.parse_method_configs(
- client_config["interfaces"][self._INTERFACE_NAME]
- )
-
- # Save a dictionary of cached API call functions.
- # These are the actual callables which invoke the proper
- # transport methods, wrapped with `wrap_method` to add retry,
- # timeout, and the like.
- self._inner_api_calls = {}
-
- # Service calls
- def list_clusters(
- self,
- project_id=None,
- zone=None,
- parent=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Lists all clusters owned by a project in either the specified zone or all
- zones.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.list_clusters()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number
`__. This field
- has been deprecated and replaced by the parent field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides, or "-" for all zones. This field has been
- deprecated and replaced by the parent field.
- parent (str): The parent (project and location) where the clusters will be listed.
- Specified in the format ``projects/*/locations/*``. Location "-" matches
- all zones and all regions.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.ListClustersResponse` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "list_clusters" not in self._inner_api_calls:
- self._inner_api_calls[
- "list_clusters"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.list_clusters,
- default_retry=self._method_configs["ListClusters"].retry,
- default_timeout=self._method_configs["ListClusters"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.ListClustersRequest(
- project_id=project_id, zone=zone, parent=parent
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("parent", parent)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["list_clusters"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def get_cluster(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Gets the details of a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.get_cluster()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to retrieve.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to retrieve.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Cluster` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "get_cluster" not in self._inner_api_calls:
- self._inner_api_calls[
- "get_cluster"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.get_cluster,
- default_retry=self._method_configs["GetCluster"].retry,
- default_timeout=self._method_configs["GetCluster"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.GetClusterRequest(
- project_id=project_id, zone=zone, cluster_id=cluster_id, name=name
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["get_cluster"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def create_cluster(
- self,
- cluster,
- project_id=None,
- zone=None,
- parent=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Creates a cluster, consisting of the specified number and type of Google
- Compute Engine instances.
-
- By default, the cluster is created in the project's `default
- network `__.
-
- One firewall is added for the cluster. After cluster creation, the
- Kubelet creates routes for each node to allow the containers on that
- node to communicate with all other instances in the cluster.
-
- Finally, an entry is added to the project's global metadata indicating
- which CIDR range the cluster is using.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `cluster`:
- >>> cluster = {}
- >>>
- >>> response = client.create_cluster(cluster)
-
- Args:
- cluster (Union[dict, ~google.cloud.container_v1.types.Cluster]): Required. A `cluster
- resource `__
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.Cluster`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the parent field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the parent field.
- parent (str): The parent (project and location) where the cluster will be created.
- Specified in the format ``projects/*/locations/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "create_cluster" not in self._inner_api_calls:
- self._inner_api_calls[
- "create_cluster"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.create_cluster,
- default_retry=self._method_configs["CreateCluster"].retry,
- default_timeout=self._method_configs["CreateCluster"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.CreateClusterRequest(
- cluster=cluster, project_id=project_id, zone=zone, parent=parent
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("parent", parent)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["create_cluster"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def update_cluster(
- self,
- update,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Updates the settings of a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `update`:
- >>> update = {}
- >>>
- >>> response = client.update_cluster(update)
-
- Args:
- update (Union[dict, ~google.cloud.container_v1.types.ClusterUpdate]): Required. A description of the update.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.ClusterUpdate`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to update.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "update_cluster" not in self._inner_api_calls:
- self._inner_api_calls[
- "update_cluster"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.update_cluster,
- default_retry=self._method_configs["UpdateCluster"].retry,
- default_timeout=self._method_configs["UpdateCluster"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.UpdateClusterRequest(
- update=update,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["update_cluster"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def update_node_pool(
- self,
- node_version,
- image_type,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Updates the version and/or image type for the specified node pool.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `node_version`:
- >>> node_version = ''
- >>>
- >>> # TODO: Initialize `image_type`:
- >>> image_type = ''
- >>>
- >>> response = client.update_node_pool(node_version, image_type)
-
- Args:
- node_version (str): Required. The Kubernetes version to change the nodes to (typically an
- upgrade).
-
- Users may specify either explicit versions offered by Kubernetes Engine or
- version aliases, which have the following behavior:
-
- - "latest": picks the highest valid Kubernetes version
- - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
- - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
- - "1.X.Y-gke.N": picks an explicit Kubernetes version
- - "-": picks the Kubernetes master version
- image_type (str): Required. The desired image type for the node pool.
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool) of the node pool to
- update. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "update_node_pool" not in self._inner_api_calls:
- self._inner_api_calls[
- "update_node_pool"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.update_node_pool,
- default_retry=self._method_configs["UpdateNodePool"].retry,
- default_timeout=self._method_configs["UpdateNodePool"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.UpdateNodePoolRequest(
- node_version=node_version,
- image_type=image_type,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["update_node_pool"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_node_pool_autoscaling(
- self,
- autoscaling,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the autoscaling settings for the specified node pool.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `autoscaling`:
- >>> autoscaling = {}
- >>>
- >>> response = client.set_node_pool_autoscaling(autoscaling)
-
- Args:
- autoscaling (Union[dict, ~google.cloud.container_v1.types.NodePoolAutoscaling]): Required. Autoscaling configuration for the node pool.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.NodePoolAutoscaling`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool) of the node pool to set
- autoscaler settings. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_node_pool_autoscaling" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_node_pool_autoscaling"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_node_pool_autoscaling,
- default_retry=self._method_configs["SetNodePoolAutoscaling"].retry,
- default_timeout=self._method_configs["SetNodePoolAutoscaling"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetNodePoolAutoscalingRequest(
- autoscaling=autoscaling,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_node_pool_autoscaling"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_logging_service(
- self,
- logging_service,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the logging service for a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `logging_service`:
- >>> logging_service = ''
- >>>
- >>> response = client.set_logging_service(logging_service)
-
- Args:
- logging_service (str): Required. The logging service the cluster should use to write metrics.
- Currently available options:
-
- - "logging.googleapis.com" - the Google Cloud Logging service
- - "none" - no metrics will be exported from the cluster
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to set logging.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_logging_service" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_logging_service"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_logging_service,
- default_retry=self._method_configs["SetLoggingService"].retry,
- default_timeout=self._method_configs["SetLoggingService"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetLoggingServiceRequest(
- logging_service=logging_service,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_logging_service"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_monitoring_service(
- self,
- monitoring_service,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the monitoring service for a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `monitoring_service`:
- >>> monitoring_service = ''
- >>>
- >>> response = client.set_monitoring_service(monitoring_service)
-
- Args:
- monitoring_service (str): Required. The monitoring service the cluster should use to write
- metrics. Currently available options:
-
- - "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring
- service with Kubernetes-native resource model
- - "monitoring.googleapis.com" - the Google Cloud Monitoring service
- - "none" - no metrics will be exported from the cluster
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to set monitoring.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_monitoring_service" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_monitoring_service"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_monitoring_service,
- default_retry=self._method_configs["SetMonitoringService"].retry,
- default_timeout=self._method_configs["SetMonitoringService"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetMonitoringServiceRequest(
- monitoring_service=monitoring_service,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_monitoring_service"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_addons_config(
- self,
- addons_config,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the addons for a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `addons_config`:
- >>> addons_config = {}
- >>>
- >>> response = client.set_addons_config(addons_config)
-
- Args:
- addons_config (Union[dict, ~google.cloud.container_v1.types.AddonsConfig]): Required. The desired configurations for the various addons available to run in the
- cluster.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.AddonsConfig`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to set addons.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_addons_config" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_addons_config"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_addons_config,
- default_retry=self._method_configs["SetAddonsConfig"].retry,
- default_timeout=self._method_configs["SetAddonsConfig"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetAddonsConfigRequest(
- addons_config=addons_config,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_addons_config"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_locations(
- self,
- locations,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the locations for a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `locations`:
- >>> locations = []
- >>>
- >>> response = client.set_locations(locations)
-
- Args:
- locations (list[str]): Required. The desired list of Google Compute Engine
- `zones `__ in
- which the cluster's nodes should be located. Changing the locations a
- cluster is in will result in nodes being either created or removed from
- the cluster, depending on whether locations are being added or removed.
-
- This list must always include the cluster's primary zone.
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to set locations.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_locations" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_locations"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_locations,
- default_retry=self._method_configs["SetLocations"].retry,
- default_timeout=self._method_configs["SetLocations"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetLocationsRequest(
- locations=locations,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_locations"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def update_master(
- self,
- master_version,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Updates the master for a specific cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `master_version`:
- >>> master_version = ''
- >>>
- >>> response = client.update_master(master_version)
-
- Args:
- master_version (str): Required. The Kubernetes version to change the master to.
-
- Users may specify either explicit versions offered by Kubernetes Engine or
- version aliases, which have the following behavior:
-
- - "latest": picks the highest valid Kubernetes version
- - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
- - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
- - "1.X.Y-gke.N": picks an explicit Kubernetes version
- - "-": picks the default Kubernetes version
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to update.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "update_master" not in self._inner_api_calls:
- self._inner_api_calls[
- "update_master"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.update_master,
- default_retry=self._method_configs["UpdateMaster"].retry,
- default_timeout=self._method_configs["UpdateMaster"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.UpdateMasterRequest(
- master_version=master_version,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["update_master"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_master_auth(
- self,
- action,
- update,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets master auth materials. Currently supports changing the admin password
- or a specific cluster, either via password generation or explicitly setting
- the password.
-
- Example:
- >>> from google.cloud import container_v1
- >>> from google.cloud.container_v1 import enums
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `action`:
- >>> action = enums.SetMasterAuthRequest.Action.UNKNOWN
- >>>
- >>> # TODO: Initialize `update`:
- >>> update = {}
- >>>
- >>> response = client.set_master_auth(action, update)
-
- Args:
- action (~google.cloud.container_v1.types.Action): Required. The exact form of action to be taken on the master auth.
- update (Union[dict, ~google.cloud.container_v1.types.MasterAuth]): Required. A description of the update.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.MasterAuth`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to upgrade.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to set auth.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_master_auth" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_master_auth"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_master_auth,
- default_retry=self._method_configs["SetMasterAuth"].retry,
- default_timeout=self._method_configs["SetMasterAuth"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetMasterAuthRequest(
- action=action,
- update=update,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_master_auth"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def delete_cluster(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Deletes the cluster, including the Kubernetes endpoint and all worker
- nodes.
-
- Firewalls and routes that were configured during cluster creation
- are also deleted.
-
- Other Google Compute Engine resources that might be in use by the cluster,
- such as load balancer resources, are not deleted if they weren't present
- when the cluster was initially created.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.delete_cluster()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to delete.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster) of the cluster to delete.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "delete_cluster" not in self._inner_api_calls:
- self._inner_api_calls[
- "delete_cluster"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.delete_cluster,
- default_retry=self._method_configs["DeleteCluster"].retry,
- default_timeout=self._method_configs["DeleteCluster"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.DeleteClusterRequest(
- project_id=project_id, zone=zone, cluster_id=cluster_id, name=name
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["delete_cluster"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def list_operations(
- self,
- project_id=None,
- zone=None,
- parent=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Lists all operations in a project in a specific zone or all zones.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.list_operations()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the parent field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ to
- return operations for, or ``-`` for all zones. This field has been
- deprecated and replaced by the parent field.
- parent (str): The parent (project and location) where the operations will be listed.
- Specified in the format ``projects/*/locations/*``. Location "-" matches
- all zones and all regions.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.ListOperationsResponse` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "list_operations" not in self._inner_api_calls:
- self._inner_api_calls[
- "list_operations"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.list_operations,
- default_retry=self._method_configs["ListOperations"].retry,
- default_timeout=self._method_configs["ListOperations"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.ListOperationsRequest(
- project_id=project_id, zone=zone, parent=parent
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("parent", parent)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["list_operations"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def get_operation(
- self,
- project_id=None,
- zone=None,
- operation_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Gets the specified operation.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.get_operation()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- operation_id (str): Deprecated. The server-assigned ``name`` of the operation. This field
- has been deprecated and replaced by the name field.
- name (str): The name (project, location, operation id) of the operation to get.
- Specified in the format ``projects/*/locations/*/operations/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "get_operation" not in self._inner_api_calls:
- self._inner_api_calls[
- "get_operation"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.get_operation,
- default_retry=self._method_configs["GetOperation"].retry,
- default_timeout=self._method_configs["GetOperation"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.GetOperationRequest(
- project_id=project_id, zone=zone, operation_id=operation_id, name=name
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["get_operation"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def cancel_operation(
- self,
- project_id=None,
- zone=None,
- operation_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Cancels the specified operation.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> client.cancel_operation()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the operation resides. This field has been deprecated and replaced
- by the name field.
- operation_id (str): Deprecated. The server-assigned ``name`` of the operation. This field
- has been deprecated and replaced by the name field.
- name (str): The name (project, location, operation id) of the operation to cancel.
- Specified in the format ``projects/*/locations/*/operations/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "cancel_operation" not in self._inner_api_calls:
- self._inner_api_calls[
- "cancel_operation"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.cancel_operation,
- default_retry=self._method_configs["CancelOperation"].retry,
- default_timeout=self._method_configs["CancelOperation"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.CancelOperationRequest(
- project_id=project_id, zone=zone, operation_id=operation_id, name=name
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- self._inner_api_calls["cancel_operation"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def get_server_config(
- self,
- project_id=None,
- zone=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Returns configuration info about the Google Kubernetes Engine service.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.get_server_config()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ to
- return operations for. This field has been deprecated and replaced by
- the name field.
- name (str): The name (project and location) of the server config to get, specified
- in the format ``projects/*/locations/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.ServerConfig` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "get_server_config" not in self._inner_api_calls:
- self._inner_api_calls[
- "get_server_config"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.get_server_config,
- default_retry=self._method_configs["GetServerConfig"].retry,
- default_timeout=self._method_configs["GetServerConfig"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.GetServerConfigRequest(
- project_id=project_id, zone=zone, name=name
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["get_server_config"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def list_node_pools(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- parent=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Lists the node pools for a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.list_node_pools()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the parent field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the parent field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the parent field.
- parent (str): The parent (project, location, cluster id) where the node pools will be
- listed. Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.ListNodePoolsResponse` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "list_node_pools" not in self._inner_api_calls:
- self._inner_api_calls[
- "list_node_pools"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.list_node_pools,
- default_retry=self._method_configs["ListNodePools"].retry,
- default_timeout=self._method_configs["ListNodePools"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.ListNodePoolsRequest(
- project_id=project_id, zone=zone, cluster_id=cluster_id, parent=parent
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("parent", parent)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["list_node_pools"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def get_node_pool(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Retrieves the requested node pool.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.get_node_pool()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool id) of the node pool to
- get. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.NodePool` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "get_node_pool" not in self._inner_api_calls:
- self._inner_api_calls[
- "get_node_pool"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.get_node_pool,
- default_retry=self._method_configs["GetNodePool"].retry,
- default_timeout=self._method_configs["GetNodePool"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.GetNodePoolRequest(
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["get_node_pool"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def create_node_pool(
- self,
- node_pool,
- project_id=None,
- zone=None,
- cluster_id=None,
- parent=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Creates a node pool for a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `node_pool`:
- >>> node_pool = {}
- >>>
- >>> response = client.create_node_pool(node_pool)
-
- Args:
- node_pool (Union[dict, ~google.cloud.container_v1.types.NodePool]): Required. The node pool to create.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.NodePool`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the parent field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the parent field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the parent field.
- parent (str): The parent (project, location, cluster id) where the node pool will be
- created. Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "create_node_pool" not in self._inner_api_calls:
- self._inner_api_calls[
- "create_node_pool"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.create_node_pool,
- default_retry=self._method_configs["CreateNodePool"].retry,
- default_timeout=self._method_configs["CreateNodePool"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.CreateNodePoolRequest(
- node_pool=node_pool,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- parent=parent,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("parent", parent)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["create_node_pool"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def delete_node_pool(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Deletes a node pool from a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.delete_node_pool()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool to delete.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool id) of the node pool to
- delete. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "delete_node_pool" not in self._inner_api_calls:
- self._inner_api_calls[
- "delete_node_pool"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.delete_node_pool,
- default_retry=self._method_configs["DeleteNodePool"].retry,
- default_timeout=self._method_configs["DeleteNodePool"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.DeleteNodePoolRequest(
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["delete_node_pool"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def rollback_node_pool_upgrade(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Rolls back a previously Aborted or Failed NodePool upgrade.
- This makes no changes if the last upgrade successfully completed.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.rollback_node_pool_upgrade()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to rollback.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool to rollback.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool id) of the node poll to
- rollback upgrade. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "rollback_node_pool_upgrade" not in self._inner_api_calls:
- self._inner_api_calls[
- "rollback_node_pool_upgrade"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.rollback_node_pool_upgrade,
- default_retry=self._method_configs["RollbackNodePoolUpgrade"].retry,
- default_timeout=self._method_configs["RollbackNodePoolUpgrade"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.RollbackNodePoolUpgradeRequest(
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["rollback_node_pool_upgrade"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_node_pool_management(
- self,
- management,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the NodeManagement options for a node pool.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `management`:
- >>> management = {}
- >>>
- >>> response = client.set_node_pool_management(management)
-
- Args:
- management (Union[dict, ~google.cloud.container_v1.types.NodeManagement]): Required. NodeManagement configuration for the node pool.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.NodeManagement`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to update.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool to update.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool id) of the node pool to
- set management properties. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_node_pool_management" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_node_pool_management"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_node_pool_management,
- default_retry=self._method_configs["SetNodePoolManagement"].retry,
- default_timeout=self._method_configs["SetNodePoolManagement"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetNodePoolManagementRequest(
- management=management,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_node_pool_management"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_labels(
- self,
- resource_labels,
- label_fingerprint,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets labels on a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `resource_labels`:
- >>> resource_labels = {}
- >>>
- >>> # TODO: Initialize `label_fingerprint`:
- >>> label_fingerprint = ''
- >>>
- >>> response = client.set_labels(resource_labels, label_fingerprint)
-
- Args:
- resource_labels (dict[str -> str]): Required. The labels to set for that cluster.
- label_fingerprint (str): Required. The fingerprint of the previous set of labels for this resource,
- used to detect conflicts. The fingerprint is initially generated by
- Kubernetes Engine and changes after every request to modify or update
- labels. You must always provide an up-to-date fingerprint hash when
- updating or changing labels. Make a get() request to the
- resource to get the latest fingerprint.
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster id) of the cluster to set labels.
- Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_labels" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_labels"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_labels,
- default_retry=self._method_configs["SetLabels"].retry,
- default_timeout=self._method_configs["SetLabels"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetLabelsRequest(
- resource_labels=resource_labels,
- label_fingerprint=label_fingerprint,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_labels"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_legacy_abac(
- self,
- enabled,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Enables or disables the ABAC authorization mechanism on a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `enabled`:
- >>> enabled = False
- >>>
- >>> response = client.set_legacy_abac(enabled)
-
- Args:
- enabled (bool): Required. Whether ABAC authorization will be enabled in the cluster.
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to update.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster id) of the cluster to set legacy
- abac. Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_legacy_abac" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_legacy_abac"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_legacy_abac,
- default_retry=self._method_configs["SetLegacyAbac"].retry,
- default_timeout=self._method_configs["SetLegacyAbac"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetLegacyAbacRequest(
- enabled=enabled,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_legacy_abac"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def start_i_p_rotation(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- rotate_credentials=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Starts master IP rotation.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.start_i_p_rotation()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster id) of the cluster to start IP
- rotation. Specified in the format ``projects/*/locations/*/clusters/*``.
- rotate_credentials (bool): Whether to rotate credentials during IP rotation.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "start_i_p_rotation" not in self._inner_api_calls:
- self._inner_api_calls[
- "start_i_p_rotation"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.start_i_p_rotation,
- default_retry=self._method_configs["StartIPRotation"].retry,
- default_timeout=self._method_configs["StartIPRotation"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.StartIPRotationRequest(
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- rotate_credentials=rotate_credentials,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["start_i_p_rotation"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def complete_i_p_rotation(
- self,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Completes master IP rotation.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> response = client.complete_i_p_rotation()
-
- Args:
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster id) of the cluster to complete IP
- rotation. Specified in the format ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "complete_i_p_rotation" not in self._inner_api_calls:
- self._inner_api_calls[
- "complete_i_p_rotation"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.complete_i_p_rotation,
- default_retry=self._method_configs["CompleteIPRotation"].retry,
- default_timeout=self._method_configs["CompleteIPRotation"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.CompleteIPRotationRequest(
- project_id=project_id, zone=zone, cluster_id=cluster_id, name=name
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["complete_i_p_rotation"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_node_pool_size(
- self,
- node_count,
- project_id=None,
- zone=None,
- cluster_id=None,
- node_pool_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the size for a specific node pool.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `node_count`:
- >>> node_count = 0
- >>>
- >>> response = client.set_node_pool_size(node_count)
-
- Args:
- node_count (int): Required. The desired node count for the pool.
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__. This field
- has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster to update.
- This field has been deprecated and replaced by the name field.
- node_pool_id (str): Deprecated. The name of the node pool to update.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster, node pool id) of the node pool to
- set size. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_node_pool_size" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_node_pool_size"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_node_pool_size,
- default_retry=self._method_configs["SetNodePoolSize"].retry,
- default_timeout=self._method_configs["SetNodePoolSize"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetNodePoolSizeRequest(
- node_count=node_count,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- node_pool_id=node_pool_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_node_pool_size"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_network_policy(
- self,
- network_policy,
- project_id=None,
- zone=None,
- cluster_id=None,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Enables or disables Network Policy for a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `network_policy`:
- >>> network_policy = {}
- >>>
- >>> response = client.set_network_policy(network_policy)
-
- Args:
- network_policy (Union[dict, ~google.cloud.container_v1.types.NetworkPolicy]): Required. Configuration options for the NetworkPolicy feature.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.NetworkPolicy`
- project_id (str): Deprecated. The Google Developers Console `project ID or project
- number `__.
- This field has been deprecated and replaced by the name field.
- zone (str): Deprecated. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides. This field has been deprecated and replaced
- by the name field.
- cluster_id (str): Deprecated. The name of the cluster.
- This field has been deprecated and replaced by the name field.
- name (str): The name (project, location, cluster id) of the cluster to set
- networking policy. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_network_policy" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_network_policy"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_network_policy,
- default_retry=self._method_configs["SetNetworkPolicy"].retry,
- default_timeout=self._method_configs["SetNetworkPolicy"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetNetworkPolicyRequest(
- network_policy=network_policy,
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_network_policy"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def set_maintenance_policy(
- self,
- project_id,
- zone,
- cluster_id,
- maintenance_policy,
- name=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Sets the maintenance policy for a cluster.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # TODO: Initialize `project_id`:
- >>> project_id = ''
- >>>
- >>> # TODO: Initialize `zone`:
- >>> zone = ''
- >>>
- >>> # TODO: Initialize `cluster_id`:
- >>> cluster_id = ''
- >>>
- >>> # TODO: Initialize `maintenance_policy`:
- >>> maintenance_policy = {}
- >>>
- >>> response = client.set_maintenance_policy(project_id, zone, cluster_id, maintenance_policy)
-
- Args:
- project_id (str): Required. The Google Developers Console `project ID or project
- number `__.
- zone (str): Required. The name of the Google Compute Engine
- `zone `__ in
- which the cluster resides.
- cluster_id (str): Required. The name of the cluster to update.
- maintenance_policy (Union[dict, ~google.cloud.container_v1.types.MaintenancePolicy]): Required. The maintenance policy to be set for the cluster. An empty field
- clears the existing maintenance policy.
-
- If a dict is provided, it must be of the same form as the protobuf
- message :class:`~google.cloud.container_v1.types.MaintenancePolicy`
- name (str): The name (project, location, cluster id) of the cluster to set
- maintenance policy. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.cloud.container_v1.types.Operation` instance.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "set_maintenance_policy" not in self._inner_api_calls:
- self._inner_api_calls[
- "set_maintenance_policy"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.set_maintenance_policy,
- default_retry=self._method_configs["SetMaintenancePolicy"].retry,
- default_timeout=self._method_configs["SetMaintenancePolicy"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.SetMaintenancePolicyRequest(
- project_id=project_id,
- zone=zone,
- cluster_id=cluster_id,
- maintenance_policy=maintenance_policy,
- name=name,
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("name", name)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- return self._inner_api_calls["set_maintenance_policy"](
- request, retry=retry, timeout=timeout, metadata=metadata
- )
-
- def list_usable_subnetworks(
- self,
- parent=None,
- filter_=None,
- page_size=None,
- retry=google.api_core.gapic_v1.method.DEFAULT,
- timeout=google.api_core.gapic_v1.method.DEFAULT,
- metadata=None,
- ):
- """
- Lists subnetworks that are usable for creating clusters in a project.
-
- Example:
- >>> from google.cloud import container_v1
- >>>
- >>> client = container_v1.ClusterManagerClient()
- >>>
- >>> # Iterate over all results
- >>> for element in client.list_usable_subnetworks():
- ... # process element
- ... pass
- >>>
- >>>
- >>> # Alternatively:
- >>>
- >>> # Iterate over results one page at a time
- >>> for page in client.list_usable_subnetworks().pages:
- ... for element in page:
- ... # process element
- ... pass
-
- Args:
- parent (str): The parent project where subnetworks are usable. Specified in the format
- ``projects/*``.
- filter_ (str): Filtering currently only supports equality on the networkProjectId and
- must be in the form: "networkProjectId=[PROJECTID]", where
- ``networkProjectId`` is the project which owns the listed subnetworks.
- This defaults to the parent project ID.
- page_size (int): The maximum number of resources contained in the
- underlying API response. If page streaming is performed per-
- resource, this parameter does not affect the return value. If page
- streaming is performed per-page, this determines the maximum number
- of resources in a page.
- retry (Optional[google.api_core.retry.Retry]): A retry object used
- to retry requests. If ``None`` is specified, requests will
- be retried using a default configuration.
- timeout (Optional[float]): The amount of time, in seconds, to wait
- for the request to complete. Note that if ``retry`` is
- specified, the timeout applies to each individual attempt.
- metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
- that is provided to the method.
-
- Returns:
- A :class:`~google.api_core.page_iterator.PageIterator` instance.
- An iterable of :class:`~google.cloud.container_v1.types.UsableSubnetwork` instances.
- You can also iterate over the pages of the response
- using its `pages` property.
-
- Raises:
- google.api_core.exceptions.GoogleAPICallError: If the request
- failed for any reason.
- google.api_core.exceptions.RetryError: If the request failed due
- to a retryable error and retry attempts failed.
- ValueError: If the parameters are invalid.
- """
- # Wrap the transport method to add retry and timeout logic.
- if "list_usable_subnetworks" not in self._inner_api_calls:
- self._inner_api_calls[
- "list_usable_subnetworks"
- ] = google.api_core.gapic_v1.method.wrap_method(
- self.transport.list_usable_subnetworks,
- default_retry=self._method_configs["ListUsableSubnetworks"].retry,
- default_timeout=self._method_configs["ListUsableSubnetworks"].timeout,
- client_info=self._client_info,
- )
-
- request = cluster_service_pb2.ListUsableSubnetworksRequest(
- parent=parent, filter=filter_, page_size=page_size
- )
- if metadata is None:
- metadata = []
- metadata = list(metadata)
- try:
- routing_header = [("parent", parent)]
- except AttributeError:
- pass
- else:
- routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
- routing_header
- )
- metadata.append(routing_metadata)
-
- iterator = google.api_core.page_iterator.GRPCIterator(
- client=None,
- method=functools.partial(
- self._inner_api_calls["list_usable_subnetworks"],
- retry=retry,
- timeout=timeout,
- metadata=metadata,
- ),
- request=request,
- items_field="subnetworks",
- request_token_field="page_token",
- response_token_field="next_page_token",
- )
- return iterator
diff --git a/google/cloud/container_v1/gapic/cluster_manager_client_config.py b/google/cloud/container_v1/gapic/cluster_manager_client_config.py
deleted file mode 100644
index 1a761ab1..00000000
--- a/google/cloud/container_v1/gapic/cluster_manager_client_config.py
+++ /dev/null
@@ -1,178 +0,0 @@
-config = {
- "interfaces": {
- "google.container.v1.ClusterManager": {
- "retry_codes": {
- "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
- "non_idempotent": [],
- },
- "retry_params": {
- "default": {
- "initial_retry_delay_millis": 100,
- "retry_delay_multiplier": 1.3,
- "max_retry_delay_millis": 60000,
- "initial_rpc_timeout_millis": 20000,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 20000,
- "total_timeout_millis": 600000,
- }
- },
- "methods": {
- "ListClusters": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "GetCluster": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "CreateCluster": {
- "timeout_millis": 45000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "UpdateCluster": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "UpdateNodePool": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetNodePoolAutoscaling": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetLoggingService": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetMonitoringService": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetAddonsConfig": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetLocations": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "UpdateMaster": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetMasterAuth": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "DeleteCluster": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "ListOperations": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "GetOperation": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "CancelOperation": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "GetServerConfig": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "ListNodePools": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "GetNodePool": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- "CreateNodePool": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "DeleteNodePool": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "RollbackNodePoolUpgrade": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetNodePoolManagement": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetLabels": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetLegacyAbac": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "StartIPRotation": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "CompleteIPRotation": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetNodePoolSize": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetNetworkPolicy": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "SetMaintenancePolicy": {
- "timeout_millis": 60000,
- "retry_codes_name": "non_idempotent",
- "retry_params_name": "default",
- },
- "ListUsableSubnetworks": {
- "timeout_millis": 60000,
- "retry_codes_name": "idempotent",
- "retry_params_name": "default",
- },
- },
- }
- }
-}
diff --git a/google/cloud/container_v1/gapic/enums.py b/google/cloud/container_v1/gapic/enums.py
deleted file mode 100644
index eb8928a0..00000000
--- a/google/cloud/container_v1/gapic/enums.py
+++ /dev/null
@@ -1,260 +0,0 @@
-# -*- 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
-#
-# https://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.
-
-"""Wrappers for protocol buffer enum types."""
-
-import enum
-
-
-class Cluster(object):
- class Status(enum.IntEnum):
- """
- The current status of the cluster.
-
- Attributes:
- STATUS_UNSPECIFIED (int): Not set.
- PROVISIONING (int): The PROVISIONING state indicates the cluster is being created.
- RUNNING (int): The RUNNING state indicates the cluster has been created and is fully
- usable.
- RECONCILING (int): The RECONCILING state indicates that some work is actively being done on
- the cluster, such as upgrading the master or node software. Details can
- be found in the ``statusMessage`` field.
- STOPPING (int): The STOPPING state indicates the cluster is being deleted.
- ERROR (int): The ERROR state indicates the cluster may be unusable. Details can be
- found in the ``statusMessage`` field.
- DEGRADED (int): The DEGRADED state indicates the cluster requires user action to restore
- full functionality. Details can be found in the ``statusMessage`` field.
- """
-
- STATUS_UNSPECIFIED = 0
- PROVISIONING = 1
- RUNNING = 2
- RECONCILING = 3
- STOPPING = 4
- ERROR = 5
- DEGRADED = 6
-
-
-class DatabaseEncryption(object):
- class State(enum.IntEnum):
- """
- State of etcd encryption.
-
- Attributes:
- UNKNOWN (int): Should never be set
- ENCRYPTED (int): Secrets in etcd are encrypted.
- DECRYPTED (int): Secrets in etcd are stored in plain text (at etcd level) - this is
- unrelated to GCE level full disk encryption.
- """
-
- UNKNOWN = 0
- ENCRYPTED = 1
- DECRYPTED = 2
-
-
-class NetworkPolicy(object):
- class Provider(enum.IntEnum):
- """
- Allowed Network Policy providers.
-
- Attributes:
- PROVIDER_UNSPECIFIED (int): Not set
- CALICO (int): Tigera (Calico Felix).
- """
-
- PROVIDER_UNSPECIFIED = 0
- CALICO = 1
-
-
-class NodePool(object):
- class Status(enum.IntEnum):
- """
- The current status of the node pool instance.
-
- Attributes:
- STATUS_UNSPECIFIED (int): Not set.
- PROVISIONING (int): The PROVISIONING state indicates the node pool is being created.
- RUNNING (int): The RUNNING state indicates the node pool has been created
- and is fully usable.
- RUNNING_WITH_ERROR (int): The RUNNING\_WITH\_ERROR state indicates the node pool has been created
- and is partially usable. Some error state has occurred and some
- functionality may be impaired. Customer may need to reissue a request or
- trigger a new update.
- RECONCILING (int): The RECONCILING state indicates that some work is actively being done on
- the node pool, such as upgrading node software. Details can be found in
- the ``statusMessage`` field.
- STOPPING (int): The STOPPING state indicates the node pool is being deleted.
- ERROR (int): The ERROR state indicates the node pool may be unusable. Details can be
- found in the ``statusMessage`` field.
- """
-
- STATUS_UNSPECIFIED = 0
- PROVISIONING = 1
- RUNNING = 2
- RUNNING_WITH_ERROR = 3
- RECONCILING = 4
- STOPPING = 5
- ERROR = 6
-
-
-class NodeTaint(object):
- class Effect(enum.IntEnum):
- """
- Possible values for Effect in taint.
-
- Attributes:
- EFFECT_UNSPECIFIED (int): Not set
- NO_SCHEDULE (int): NoSchedule
- PREFER_NO_SCHEDULE (int): PreferNoSchedule
- NO_EXECUTE (int): NoExecute
- """
-
- EFFECT_UNSPECIFIED = 0
- NO_SCHEDULE = 1
- PREFER_NO_SCHEDULE = 2
- NO_EXECUTE = 3
-
-
-class Operation(object):
- class Status(enum.IntEnum):
- """
- Current status of the operation.
-
- Attributes:
- STATUS_UNSPECIFIED (int): Not set.
- PENDING (int): The operation has been created.
- RUNNING (int): The operation is currently running.
- DONE (int): The operation is done, either cancelled or completed.
- ABORTING (int): The operation is aborting.
- """
-
- STATUS_UNSPECIFIED = 0
- PENDING = 1
- RUNNING = 2
- DONE = 3
- ABORTING = 4
-
- class Type(enum.IntEnum):
- """
- Operation type.
-
- Attributes:
- TYPE_UNSPECIFIED (int): Not set.
- CREATE_CLUSTER (int): Cluster create.
- DELETE_CLUSTER (int): Cluster delete.
- UPGRADE_MASTER (int): A master upgrade.
- UPGRADE_NODES (int): A node upgrade.
- REPAIR_CLUSTER (int): Cluster repair.
- UPDATE_CLUSTER (int): Cluster update.
- CREATE_NODE_POOL (int): Node pool create.
- DELETE_NODE_POOL (int): Node pool delete.
- SET_NODE_POOL_MANAGEMENT (int): Set node pool management.
- AUTO_REPAIR_NODES (int): Automatic node pool repair.
- AUTO_UPGRADE_NODES (int): Automatic node upgrade.
- SET_LABELS (int): Set labels.
- SET_MASTER_AUTH (int): Set/generate master auth materials
- SET_NODE_POOL_SIZE (int): Set node pool size.
- SET_NETWORK_POLICY (int): Updates network policy for a cluster.
- SET_MAINTENANCE_POLICY (int): Set the maintenance policy.
- """
-
- TYPE_UNSPECIFIED = 0
- CREATE_CLUSTER = 1
- DELETE_CLUSTER = 2
- UPGRADE_MASTER = 3
- UPGRADE_NODES = 4
- REPAIR_CLUSTER = 5
- UPDATE_CLUSTER = 6
- CREATE_NODE_POOL = 7
- DELETE_NODE_POOL = 8
- SET_NODE_POOL_MANAGEMENT = 9
- AUTO_REPAIR_NODES = 10
- AUTO_UPGRADE_NODES = 11
- SET_LABELS = 12
- SET_MASTER_AUTH = 13
- SET_NODE_POOL_SIZE = 14
- SET_NETWORK_POLICY = 15
- SET_MAINTENANCE_POLICY = 16
-
-
-class SetMasterAuthRequest(object):
- class Action(enum.IntEnum):
- """
- Operation type: what type update to perform.
-
- Attributes:
- UNKNOWN (int): Operation is unknown and will error out.
- SET_PASSWORD (int): Set the password to a user generated value.
- GENERATE_PASSWORD (int): Generate a new password and set it to that.
- SET_USERNAME (int): Set the username. If an empty username is provided, basic authentication
- is disabled for the cluster. If a non-empty username is provided, basic
- authentication is enabled, with either a provided password or a generated
- one.
- """
-
- UNKNOWN = 0
- SET_PASSWORD = 1
- GENERATE_PASSWORD = 2
- SET_USERNAME = 3
-
-
-class StatusCondition(object):
- class Code(enum.IntEnum):
- """
- Code for each condition
-
- Attributes:
- UNKNOWN (int): UNKNOWN indicates a generic condition.
- GCE_STOCKOUT (int): GCE\_STOCKOUT indicates a Google Compute Engine stockout.
- GKE_SERVICE_ACCOUNT_DELETED (int): GKE\_SERVICE\_ACCOUNT\_DELETED indicates that the user deleted their
- robot service account.
- GCE_QUOTA_EXCEEDED (int): Google Compute Engine quota was exceeded.
- SET_BY_OPERATOR (int): Cluster state was manually changed by an SRE due to a system logic error.
- CLOUD_KMS_KEY_ERROR (int): Unable to perform an encrypt operation against the CloudKMS key used for
- etcd level encryption.
- More codes TBA
- """
-
- UNKNOWN = 0
- GCE_STOCKOUT = 1
- GKE_SERVICE_ACCOUNT_DELETED = 2
- GCE_QUOTA_EXCEEDED = 3
- SET_BY_OPERATOR = 4
- CLOUD_KMS_KEY_ERROR = 7
-
-
-class UsableSubnetworkSecondaryRange(object):
- class Status(enum.IntEnum):
- """
- Status shows the current usage of a secondary IP range.
-
- Attributes:
- UNKNOWN (int): UNKNOWN is the zero value of the Status enum. It's not a valid status.
- UNUSED (int): UNUSED denotes that this range is unclaimed by any cluster.
- IN_USE_SERVICE (int): IN\_USE\_SERVICE denotes that this range is claimed by a cluster for
- services. It cannot be used for other clusters.
- IN_USE_SHAREABLE_POD (int): IN\_USE\_SHAREABLE\_POD denotes this range was created by the network
- admin and is currently claimed by a cluster for pods. It can only be
- used by other clusters as a pod range.
- IN_USE_MANAGED_POD (int): IN\_USE\_MANAGED\_POD denotes this range was created by GKE and is
- claimed for pods. It cannot be used for other clusters.
- """
-
- UNKNOWN = 0
- UNUSED = 1
- IN_USE_SERVICE = 2
- IN_USE_SHAREABLE_POD = 3
- IN_USE_MANAGED_POD = 4
diff --git a/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py b/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py
deleted file mode 100644
index 5fad469c..00000000
--- a/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py
+++ /dev/null
@@ -1,534 +0,0 @@
-# -*- 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
-#
-# https://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 google.api_core.grpc_helpers
-
-from google.cloud.container_v1.proto import cluster_service_pb2_grpc
-
-
-class ClusterManagerGrpcTransport(object):
- """gRPC transport class providing stubs for
- google.container.v1 ClusterManager API.
-
- The transport provides access to the raw gRPC stubs,
- which can be used to take advantage of advanced
- features of gRPC.
- """
-
- # The scopes needed to make gRPC calls to all of the methods defined
- # in this service.
- _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)
-
- def __init__(
- self, channel=None, credentials=None, address="container.googleapis.com:443"
- ):
- """Instantiate the transport class.
-
- Args:
- channel (grpc.Channel): A ``Channel`` instance through
- which to make calls. This argument is mutually exclusive
- with ``credentials``; providing both will raise an exception.
- credentials (google.auth.credentials.Credentials): The
- authorization credentials to attach to requests. These
- credentials identify this application to the service. If none
- are specified, the client will attempt to ascertain the
- credentials from the environment.
- address (str): The address where the service is hosted.
- """
- # If both `channel` and `credentials` are specified, raise an
- # exception (channels come with credentials baked in already).
- if channel is not None and credentials is not None:
- raise ValueError(
- "The `channel` and `credentials` arguments are mutually " "exclusive."
- )
-
- # Create the channel.
- if channel is None:
- channel = self.create_channel(
- address=address,
- credentials=credentials,
- options={
- "grpc.max_send_message_length": -1,
- "grpc.max_receive_message_length": -1,
- }.items(),
- )
-
- self._channel = channel
-
- # gRPC uses objects called "stubs" that are bound to the
- # channel and provide a basic method for each RPC.
- self._stubs = {
- "cluster_manager_stub": cluster_service_pb2_grpc.ClusterManagerStub(channel)
- }
-
- @classmethod
- def create_channel(
- cls, address="container.googleapis.com:443", credentials=None, **kwargs
- ):
- """Create and return a gRPC channel object.
-
- Args:
- address (str): The host for the channel to use.
- credentials (~.Credentials): The
- authorization credentials to attach to requests. These
- credentials identify this application to the service. If
- none are specified, the client will attempt to ascertain
- the credentials from the environment.
- kwargs (dict): Keyword arguments, which are passed to the
- channel creation.
-
- Returns:
- grpc.Channel: A gRPC channel object.
- """
- return google.api_core.grpc_helpers.create_channel(
- address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs
- )
-
- @property
- def channel(self):
- """The gRPC channel used by the transport.
-
- Returns:
- grpc.Channel: A gRPC channel object.
- """
- return self._channel
-
- @property
- def list_clusters(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.list_clusters`.
-
- Lists all clusters owned by a project in either the specified zone or all
- zones.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].ListClusters
-
- @property
- def get_cluster(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.get_cluster`.
-
- Gets the details of a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].GetCluster
-
- @property
- def create_cluster(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.create_cluster`.
-
- Creates a cluster, consisting of the specified number and type of Google
- Compute Engine instances.
-
- By default, the cluster is created in the project's `default
- network `__.
-
- One firewall is added for the cluster. After cluster creation, the
- Kubelet creates routes for each node to allow the containers on that
- node to communicate with all other instances in the cluster.
-
- Finally, an entry is added to the project's global metadata indicating
- which CIDR range the cluster is using.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].CreateCluster
-
- @property
- def update_cluster(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.update_cluster`.
-
- Updates the settings of a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].UpdateCluster
-
- @property
- def update_node_pool(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.update_node_pool`.
-
- Updates the version and/or image type for the specified node pool.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].UpdateNodePool
-
- @property
- def set_node_pool_autoscaling(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_autoscaling`.
-
- Sets the autoscaling settings for the specified node pool.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetNodePoolAutoscaling
-
- @property
- def set_logging_service(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_logging_service`.
-
- Sets the logging service for a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetLoggingService
-
- @property
- def set_monitoring_service(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_monitoring_service`.
-
- Sets the monitoring service for a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetMonitoringService
-
- @property
- def set_addons_config(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_addons_config`.
-
- Sets the addons for a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetAddonsConfig
-
- @property
- def set_locations(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_locations`.
-
- Sets the locations for a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetLocations
-
- @property
- def update_master(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.update_master`.
-
- Updates the master for a specific cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].UpdateMaster
-
- @property
- def set_master_auth(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_master_auth`.
-
- Sets master auth materials. Currently supports changing the admin password
- or a specific cluster, either via password generation or explicitly setting
- the password.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetMasterAuth
-
- @property
- def delete_cluster(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.delete_cluster`.
-
- Deletes the cluster, including the Kubernetes endpoint and all worker
- nodes.
-
- Firewalls and routes that were configured during cluster creation
- are also deleted.
-
- Other Google Compute Engine resources that might be in use by the cluster,
- such as load balancer resources, are not deleted if they weren't present
- when the cluster was initially created.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].DeleteCluster
-
- @property
- def list_operations(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.list_operations`.
-
- Lists all operations in a project in a specific zone or all zones.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].ListOperations
-
- @property
- def get_operation(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.get_operation`.
-
- Gets the specified operation.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].GetOperation
-
- @property
- def cancel_operation(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.cancel_operation`.
-
- Cancels the specified operation.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].CancelOperation
-
- @property
- def get_server_config(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.get_server_config`.
-
- Returns configuration info about the Google Kubernetes Engine service.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].GetServerConfig
-
- @property
- def list_node_pools(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.list_node_pools`.
-
- Lists the node pools for a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].ListNodePools
-
- @property
- def get_node_pool(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.get_node_pool`.
-
- Retrieves the requested node pool.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].GetNodePool
-
- @property
- def create_node_pool(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.create_node_pool`.
-
- Creates a node pool for a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].CreateNodePool
-
- @property
- def delete_node_pool(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.delete_node_pool`.
-
- Deletes a node pool from a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].DeleteNodePool
-
- @property
- def rollback_node_pool_upgrade(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.rollback_node_pool_upgrade`.
-
- Rolls back a previously Aborted or Failed NodePool upgrade.
- This makes no changes if the last upgrade successfully completed.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].RollbackNodePoolUpgrade
-
- @property
- def set_node_pool_management(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_management`.
-
- Sets the NodeManagement options for a node pool.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetNodePoolManagement
-
- @property
- def set_labels(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_labels`.
-
- Sets labels on a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetLabels
-
- @property
- def set_legacy_abac(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_legacy_abac`.
-
- Enables or disables the ABAC authorization mechanism on a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetLegacyAbac
-
- @property
- def start_i_p_rotation(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.start_i_p_rotation`.
-
- Starts master IP rotation.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].StartIPRotation
-
- @property
- def complete_i_p_rotation(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.complete_i_p_rotation`.
-
- Completes master IP rotation.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].CompleteIPRotation
-
- @property
- def set_node_pool_size(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_size`.
-
- Sets the size for a specific node pool.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetNodePoolSize
-
- @property
- def set_network_policy(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_network_policy`.
-
- Enables or disables Network Policy for a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetNetworkPolicy
-
- @property
- def set_maintenance_policy(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.set_maintenance_policy`.
-
- Sets the maintenance policy for a cluster.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].SetMaintenancePolicy
-
- @property
- def list_usable_subnetworks(self):
- """Return the gRPC stub for :meth:`ClusterManagerClient.list_usable_subnetworks`.
-
- Lists subnetworks that are usable for creating clusters in a project.
-
- Returns:
- Callable: A callable which accepts the appropriate
- deserialized request object and returns a
- deserialized response object.
- """
- return self._stubs["cluster_manager_stub"].ListUsableSubnetworks
diff --git a/google/cloud/container_v1/proto/cluster_service.proto b/google/cloud/container_v1/proto/cluster_service.proto
index 3a798ca1..6363fc94 100644
--- a/google/cloud/container_v1/proto/cluster_service.proto
+++ b/google/cloud/container_v1/proto/cluster_service.proto
@@ -989,7 +989,7 @@ message Cluster {
string description = 2;
// The number of nodes to create in this cluster. You must ensure that your
- // Compute Engine resource quota
+ // Compute Engine [resource quota](https://cloud.google.com/compute/quotas)
// is sufficient for this number of instances. You must also have available
// firewall and routes quota.
// For requests, this field should only be used in lieu of a
@@ -2087,7 +2087,7 @@ message NodePool {
NodeConfig config = 2;
// The initial node count for the pool. You must ensure that your
- // Compute Engine resource quota
+ // Compute Engine [resource quota](https://cloud.google.com/compute/quotas)
// is sufficient for this number of instances. You must also have available
// firewall and routes quota.
int32 initial_node_count = 3;
diff --git a/google/cloud/container_v1/proto/cluster_service_pb2.py b/google/cloud/container_v1/proto/cluster_service_pb2.py
deleted file mode 100644
index 06680e72..00000000
--- a/google/cloud/container_v1/proto/cluster_service_pb2.py
+++ /dev/null
@@ -1,12620 +0,0 @@
-# -*- coding: utf-8 -*-
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: google/cloud/container_v1/proto/cluster_service.proto
-
-import sys
-
-_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
-from google.api import client_pb2 as google_dot_api_dot_client__pb2
-from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
-from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
-from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name="google/cloud/container_v1/proto/cluster_service.proto",
- package="google.container.v1",
- syntax="proto3",
- serialized_options=_b(
- "\n\027com.google.container.v1B\023ClusterServiceProtoP\001Z\n\x16\x44\x61ilyMaintenanceWindow\x12\x12\n\nstart_time\x18\x02 \x01(\t\x12\x10\n\x08\x64uration\x18\x03 \x01(\t"\xc6\x01\n\x1cSetNodePoolManagementRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12<\n\nmanagement\x18\x05 \x01(\x0b\x32#.google.container.v1.NodeManagementB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t"\x9b\x01\n\x16SetNodePoolSizeRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x17\n\nnode_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t"\x8a\x01\n\x1eRollbackNodePoolUpgradeRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x06 \x01(\t"J\n\x15ListNodePoolsResponse\x12\x31\n\nnode_pools\x18\x01 \x03(\x0b\x32\x1d.google.container.v1.NodePool"\xff\x01\n\x12\x43lusterAutoscaling\x12$\n\x1c\x65nable_node_autoprovisioning\x18\x01 \x01(\x08\x12;\n\x0fresource_limits\x18\x02 \x03(\x0b\x32".google.container.v1.ResourceLimit\x12\x62\n#autoprovisioning_node_pool_defaults\x18\x04 \x01(\x0b\x32\x35.google.container.v1.AutoprovisioningNodePoolDefaults\x12"\n\x1a\x61utoprovisioning_locations\x18\x05 \x03(\t"Q\n AutoprovisioningNodePoolDefaults\x12\x14\n\x0coauth_scopes\x18\x01 \x03(\t\x12\x17\n\x0fservice_account\x18\x02 \x01(\t"H\n\rResourceLimit\x12\x15\n\rresource_type\x18\x01 \x01(\t\x12\x0f\n\x07minimum\x18\x02 \x01(\x03\x12\x0f\n\x07maximum\x18\x03 \x01(\x03"o\n\x13NodePoolAutoscaling\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x16\n\x0emin_node_count\x18\x02 \x01(\x05\x12\x16\n\x0emax_node_count\x18\x03 \x01(\x05\x12\x17\n\x0f\x61utoprovisioned\x18\x04 \x01(\x08"\x92\x02\n\x10SetLabelsRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12W\n\x0fresource_labels\x18\x04 \x03(\x0b\x32\x39.google.container.v1.SetLabelsRequest.ResourceLabelsEntryB\x03\xe0\x41\x02\x12\x1e\n\x11label_fingerprint\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t\x1a\x35\n\x13ResourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"|\n\x14SetLegacyAbacRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x14\n\x07\x65nabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x06 \x01(\t"\x84\x01\n\x16StartIPRotationRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x1a\n\x12rotate_credentials\x18\x07 \x01(\x08"k\n\x19\x43ompleteIPRotationRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x07 \x01(\t"H\n\x11\x41\x63\x63\x65leratorConfig\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x01 \x01(\x03\x12\x18\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\t"\xaa\x01\n\x17SetNetworkPolicyRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12?\n\x0enetwork_policy\x18\x04 \x01(\x0b\x32".google.container.v1.NetworkPolicyB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x06 \x01(\t"\xb9\x01\n\x1bSetMaintenancePolicyRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ncluster_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12G\n\x12maintenance_policy\x18\x04 \x01(\x0b\x32&.google.container.v1.MaintenancePolicyB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x05 \x01(\t"\xea\x01\n\x0fStatusCondition\x12\x37\n\x04\x63ode\x18\x01 \x01(\x0e\x32).google.container.v1.StatusCondition.Code\x12\x0f\n\x07message\x18\x02 \x01(\t"\x8c\x01\n\x04\x43ode\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x10\n\x0cGCE_STOCKOUT\x10\x01\x12\x1f\n\x1bGKE_SERVICE_ACCOUNT_DELETED\x10\x02\x12\x16\n\x12GCE_QUOTA_EXCEEDED\x10\x03\x12\x13\n\x0fSET_BY_OPERATOR\x10\x04\x12\x17\n\x13\x43LOUD_KMS_KEY_ERROR\x10\x07"Z\n\rNetworkConfig\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12$\n\x1c\x65nable_intra_node_visibility\x18\x05 \x01(\x08",\n\x19IntraNodeVisibilityConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08".\n\x11MaxPodsConstraint\x12\x19\n\x11max_pods_per_node\x18\x01 \x01(\x03"\x98\x01\n\x12\x44\x61tabaseEncryption\x12<\n\x05state\x18\x02 \x01(\x0e\x32-.google.container.v1.DatabaseEncryption.State\x12\x10\n\x08key_name\x18\x01 \x01(\t"2\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tENCRYPTED\x10\x01\x12\r\n\tDECRYPTED\x10\x02"e\n\x1cListUsableSubnetworksRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"t\n\x1dListUsableSubnetworksResponse\x12:\n\x0bsubnetworks\x18\x01 \x03(\x0b\x32%.google.container.v1.UsableSubnetwork\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x80\x02\n\x1eUsableSubnetworkSecondaryRange\x12\x12\n\nrange_name\x18\x01 \x01(\t\x12\x15\n\rip_cidr_range\x18\x02 \x01(\t\x12J\n\x06status\x18\x03 \x01(\x0e\x32:.google.container.v1.UsableSubnetworkSecondaryRange.Status"g\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06UNUSED\x10\x01\x12\x12\n\x0eIN_USE_SERVICE\x10\x02\x12\x18\n\x14IN_USE_SHAREABLE_POD\x10\x03\x12\x16\n\x12IN_USE_MANAGED_POD\x10\x04"\xb8\x01\n\x10UsableSubnetwork\x12\x12\n\nsubnetwork\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x15\n\rip_cidr_range\x18\x03 \x01(\t\x12P\n\x13secondary_ip_ranges\x18\x04 \x03(\x0b\x32\x33.google.container.v1.UsableSubnetworkSecondaryRange\x12\x16\n\x0estatus_message\x18\x05 \x01(\t"\xed\x02\n\x19ResourceUsageExportConfig\x12`\n\x14\x62igquery_destination\x18\x01 \x01(\x0b\x32\x42.google.container.v1.ResourceUsageExportConfig.BigQueryDestination\x12&\n\x1e\x65nable_network_egress_metering\x18\x02 \x01(\x08\x12m\n\x1b\x63onsumption_metering_config\x18\x03 \x01(\x0b\x32H.google.container.v1.ResourceUsageExportConfig.ConsumptionMeteringConfig\x1a)\n\x13\x42igQueryDestination\x12\x12\n\ndataset_id\x18\x01 \x01(\t\x1a,\n\x19\x43onsumptionMeteringConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08")\n\x16VerticalPodAutoscaling\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x32\xd2\x44\n\x0e\x43lusterManager\x12\xe8\x01\n\x0cListClusters\x12(.google.container.v1.ListClustersRequest\x1a).google.container.v1.ListClustersResponse"\x82\x01\x82\xd3\xe4\x93\x02\x61\x12,/v1/{parent=projects/*/locations/*}/clustersZ1\x12//v1/projects/{project_id}/zones/{zone}/clusters\xda\x41\x0fproject_id,zone\xda\x41\x06parent\x12\xed\x01\n\nGetCluster\x12&.google.container.v1.GetClusterRequest\x1a\x1c.google.container.v1.Cluster"\x98\x01\x82\xd3\xe4\x93\x02n\x12,/v1/{name=projects/*/locations/*/clusters/*}Z>\x12*/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels:\x01*ZP"K/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels:\x01*\x12\xa5\x02\n\rSetLegacyAbac\x12).google.container.v1.SetLegacyAbacRequest\x1a\x1e.google.container.v1.Operation"\xc8\x01\x82\xd3\xe4\x93\x02\x8d\x01":/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac:\x01*ZL"G/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac:\x01*\xda\x41"project_id,zone,cluster_id,enabled\xda\x41\x0cname,enabled\x12\xa0\x02\n\x0fStartIPRotation\x12+.google.container.v1.StartIPRotationRequest\x1a\x1e.google.container.v1.Operation"\xbf\x01\x82\xd3\xe4\x93\x02\x94\x01"`__ (e.g.
- ``n1-standard-1``). If unspecified, the default machine type
- is ``n1-standard-1``.
- disk_size_gb:
- Size of the disk attached to each node, specified in GB. The
- smallest allowed disk size is 10GB. If unspecified, the
- default disk size is 100GB.
- oauth_scopes:
- The set of Google API scopes to be made available on all of
- the node VMs under the "default" service account. The
- following scopes are recommended, but not required, and by
- default are not included: -
- ``https://www.googleapis.com/auth/compute`` is required for
- mounting persistent storage on your nodes. -
- ``https://www.googleapis.com/auth/devstorage.read_only`` is
- required for communicating with **gcr.io** (the `Google
- Container Registry `__). If unspecified, no scopes are added, unless
- Cloud Logging or Cloud Monitoring are enabled, in which case
- their required scopes will be added.
- service_account:
- The Google Cloud Platform Service Account to be used by the
- node VMs. If no Service Account is specified, the "default"
- service account is used.
- metadata:
- The metadata key/value pairs assigned to instances in the
- cluster. Keys must conform to the regexp [a-zA-Z0-9-\_]+ and
- be less than 128 bytes in length. These are reflected as part
- of a URL in the metadata server. Additionally, to avoid
- ambiguity, keys must not conflict with any other metadata keys
- for the project or be one of the reserved keys: "cluster-
- location" "cluster-name" "cluster-uid" "configure-sh"
- "containerd-configure-sh" "enable-os-login" "gci-update-
- strategy" "gci-ensure-gke-docker" "instance-template" "kube-
- env" "startup-script" "user-data" "disable-address-manager"
- "windows-startup-script-ps1" "common-psm1" "k8s-node-setup-
- psm1" "install-ssh-psm1" "user-profile-psm1" "serial-port-
- logging-enable" Values are free-form strings, and only have
- meaning as interpreted by the image running in the instance.
- The only restriction placed on them is that each value's size
- must be less than or equal to 32 KB. The total size of all
- keys and values must be less than 512 KB.
- image_type:
- The image type to use for this node. Note that for a given
- image type, the latest version of it will be used.
- labels:
- The map of Kubernetes labels (key/value pairs) to be applied
- to each node. These will added in addition to any default
- label(s) that Kubernetes may apply to the node. In case of
- conflict in label keys, the applied set may differ depending
- on the Kubernetes version -- it's best to assume the behavior
- is undefined and conflicts should be avoided. For more
- information, including usage and the valid values, see:
- https://kubernetes.io/docs/concepts/overview/working-with-
- objects/labels/
- local_ssd_count:
- The number of local SSD disks to be attached to the node. The
- limit for this value is dependent upon the maximum number of
- disks available on a machine per zone. See:
- https://cloud.google.com/compute/docs/disks/local-ssd for more
- information.
- tags:
- The list of instance tags applied to all nodes. Tags are used
- to identify valid sources or targets for network firewalls and
- are specified by the client during cluster or node pool
- creation. Each tag within the list must comply with RFC1035.
- preemptible:
- Whether the nodes are created as preemptible VM instances.
- See:
- https://cloud.google.com/compute/docs/instances/preemptible
- for more information about preemptible VM instances.
- accelerators:
- A list of hardware accelerators to be attached to each node.
- See https://cloud.google.com/compute/docs/gpus for more
- information about support for GPUs.
- disk_type:
- Type of the disk attached to each node (e.g. 'pd-standard' or
- 'pd-ssd') If unspecified, the default disk type is 'pd-
- standard'
- min_cpu_platform:
- Minimum CPU platform to be used by this instance. The instance
- may be scheduled on the specified or newer CPU platform.
- Applicable values are the friendly names of CPU platforms,
- such as minCpuPlatform: "Intel Haswell" or minCpuPlatform:
- "Intel Sandy Bridge". For more information, read `how to
- specify min CPU platform
- `__
- taints:
- List of kubernetes taints to be applied to each node. For
- more information, including usage and the valid values, see:
- https://kubernetes.io/docs/concepts/configuration/taint-and-
- toleration/
- shielded_instance_config:
- Shielded Instance options.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NodeConfig)
- ),
-)
-_sym_db.RegisterMessage(NodeConfig)
-_sym_db.RegisterMessage(NodeConfig.MetadataEntry)
-_sym_db.RegisterMessage(NodeConfig.LabelsEntry)
-
-ShieldedInstanceConfig = _reflection.GeneratedProtocolMessageType(
- "ShieldedInstanceConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SHIELDEDINSTANCECONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""A set of Shielded Instance options.
- Attributes:
- enable_secure_boot:
- Defines whether the instance has Secure Boot enabled. Secure
- Boot helps ensure that the system only runs authentic software
- by verifying the digital signature of all boot components, and
- halting the boot process if signature verification fails.
- enable_integrity_monitoring:
- Defines whether the instance has integrity monitoring enabled.
- Enables monitoring and attestation of the boot integrity of
- the instance. The attestation is performed against the
- integrity policy baseline. This baseline is initially derived
- from the implicitly trusted boot image when the instance is
- created.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ShieldedInstanceConfig)
- ),
-)
-_sym_db.RegisterMessage(ShieldedInstanceConfig)
-
-NodeTaint = _reflection.GeneratedProtocolMessageType(
- "NodeTaint",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NODETAINT,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Kubernetes taint is comprised of three fields: key, value, and effect.
- Effect can only be one of three types: NoSchedule, PreferNoSchedule or
- NoExecute. For more information, including usage and the valid
- values, see: https://kubernetes.io/docs/concepts/configuration/taint-
- and-toleration/
- Attributes:
- key:
- Key for taint.
- value:
- Value for taint.
- effect:
- Effect for taint.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NodeTaint)
- ),
-)
-_sym_db.RegisterMessage(NodeTaint)
-
-MasterAuth = _reflection.GeneratedProtocolMessageType(
- "MasterAuth",
- (_message.Message,),
- dict(
- DESCRIPTOR=_MASTERAUTH,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""The authentication information for accessing the master endpoint.
- Authentication can be done using HTTP basic auth or using client
- certificates.
- Attributes:
- username:
- The username to use for HTTP basic authentication to the
- master endpoint. For clusters v1.6.0 and later, basic
- authentication can be disabled by leaving username unspecified
- (or setting it to the empty string).
- password:
- The password to use for HTTP basic authentication to the
- master endpoint. Because the master endpoint is open to the
- Internet, you should create a strong password. If a password
- is provided for cluster creation, username must be non-empty.
- client_certificate_config:
- Configuration for client certificate authentication on the
- cluster. For clusters before v1.12, if no configuration is
- specified, a client certificate is issued.
- cluster_ca_certificate:
- [Output only] Base64-encoded public certificate that is the
- root of trust for the cluster.
- client_certificate:
- [Output only] Base64-encoded public certificate used by
- clients to authenticate to the cluster endpoint.
- client_key:
- [Output only] Base64-encoded private key used by clients to
- authenticate to the cluster endpoint.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.MasterAuth)
- ),
-)
-_sym_db.RegisterMessage(MasterAuth)
-
-ClientCertificateConfig = _reflection.GeneratedProtocolMessageType(
- "ClientCertificateConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CLIENTCERTIFICATECONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for client certificates on the cluster.
- Attributes:
- issue_client_certificate:
- Issue a client certificate.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ClientCertificateConfig)
- ),
-)
-_sym_db.RegisterMessage(ClientCertificateConfig)
-
-AddonsConfig = _reflection.GeneratedProtocolMessageType(
- "AddonsConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_ADDONSCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for the addons that can be automatically spun up in the
- cluster, enabling additional functionality.
- Attributes:
- http_load_balancing:
- Configuration for the HTTP (L7) load balancing controller
- addon, which makes it easy to set up HTTP load balancers for
- services in a cluster.
- horizontal_pod_autoscaling:
- Configuration for the horizontal pod autoscaling feature,
- which increases or decreases the number of replica pods a
- replication controller has based on the resource usage of the
- existing pods.
- kubernetes_dashboard:
- Configuration for the Kubernetes Dashboard. This addon is
- deprecated, and will be disabled in 1.15. It is recommended to
- use the Cloud Console to manage and monitor your Kubernetes
- clusters, workloads and applications. For more information,
- see: https://cloud.google.com/kubernetes-
- engine/docs/concepts/dashboards
- network_policy_config:
- Configuration for NetworkPolicy. This only tracks whether the
- addon is enabled or not on the Master, it does not track
- whether network policy is enabled for the nodes.
- cloud_run_config:
- Configuration for the Cloud Run addon, which allows the user
- to use a managed Knative service.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.AddonsConfig)
- ),
-)
-_sym_db.RegisterMessage(AddonsConfig)
-
-HttpLoadBalancing = _reflection.GeneratedProtocolMessageType(
- "HttpLoadBalancing",
- (_message.Message,),
- dict(
- DESCRIPTOR=_HTTPLOADBALANCING,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration options for the HTTP (L7) load balancing controller
- addon, which makes it easy to set up HTTP load balancers for services
- in a cluster.
- Attributes:
- disabled:
- Whether the HTTP Load Balancing controller is enabled in the
- cluster. When enabled, it runs a small pod in the cluster that
- manages the load balancers.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.HttpLoadBalancing)
- ),
-)
-_sym_db.RegisterMessage(HttpLoadBalancing)
-
-HorizontalPodAutoscaling = _reflection.GeneratedProtocolMessageType(
- "HorizontalPodAutoscaling",
- (_message.Message,),
- dict(
- DESCRIPTOR=_HORIZONTALPODAUTOSCALING,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration options for the horizontal pod autoscaling feature,
- which increases or decreases the number of replica pods a replication
- controller has based on the resource usage of the existing pods.
- Attributes:
- disabled:
- Whether the Horizontal Pod Autoscaling feature is enabled in
- the cluster. When enabled, it ensures that a Heapster pod is
- running in the cluster, which is also used by the Cloud
- Monitoring service.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.HorizontalPodAutoscaling)
- ),
-)
-_sym_db.RegisterMessage(HorizontalPodAutoscaling)
-
-KubernetesDashboard = _reflection.GeneratedProtocolMessageType(
- "KubernetesDashboard",
- (_message.Message,),
- dict(
- DESCRIPTOR=_KUBERNETESDASHBOARD,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for the Kubernetes Dashboard.
- Attributes:
- disabled:
- Whether the Kubernetes Dashboard is enabled for this cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.KubernetesDashboard)
- ),
-)
-_sym_db.RegisterMessage(KubernetesDashboard)
-
-NetworkPolicyConfig = _reflection.GeneratedProtocolMessageType(
- "NetworkPolicyConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NETWORKPOLICYCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for NetworkPolicy. This only tracks whether the addon is
- enabled or not on the Master, it does not track whether network policy
- is enabled for the nodes.
- Attributes:
- disabled:
- Whether NetworkPolicy is enabled for this cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NetworkPolicyConfig)
- ),
-)
-_sym_db.RegisterMessage(NetworkPolicyConfig)
-
-PrivateClusterConfig = _reflection.GeneratedProtocolMessageType(
- "PrivateClusterConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_PRIVATECLUSTERCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration options for private clusters.
- Attributes:
- enable_private_nodes:
- Whether nodes have internal IP addresses only. If enabled, all
- nodes are given only RFC 1918 private addresses and
- communicate with the master via private networking.
- enable_private_endpoint:
- Whether the master's internal IP address is used as the
- cluster endpoint.
- master_ipv4_cidr_block:
- The IP range in CIDR notation to use for the hosted master
- network. This range will be used for assigning internal IP
- addresses to the master or set of masters, as well as the ILB
- VIP. This range must not overlap with any other ranges in use
- within the cluster's network.
- private_endpoint:
- Output only. The internal IP address of this cluster's master
- endpoint.
- public_endpoint:
- Output only. The external IP address of this cluster's master
- endpoint.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.PrivateClusterConfig)
- ),
-)
-_sym_db.RegisterMessage(PrivateClusterConfig)
-
-AuthenticatorGroupsConfig = _reflection.GeneratedProtocolMessageType(
- "AuthenticatorGroupsConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_AUTHENTICATORGROUPSCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for returning group information from authenticators.
- Attributes:
- enabled:
- Whether this cluster should return group membership lookups
- during authentication using a group of security groups.
- security_group:
- The name of the security group-of-groups to be used. Only
- relevant if enabled = true.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.AuthenticatorGroupsConfig)
- ),
-)
-_sym_db.RegisterMessage(AuthenticatorGroupsConfig)
-
-CloudRunConfig = _reflection.GeneratedProtocolMessageType(
- "CloudRunConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CLOUDRUNCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration options for the Cloud Run feature.
- Attributes:
- disabled:
- Whether Cloud Run addon is enabled for this cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.CloudRunConfig)
- ),
-)
-_sym_db.RegisterMessage(CloudRunConfig)
-
-MasterAuthorizedNetworksConfig = _reflection.GeneratedProtocolMessageType(
- "MasterAuthorizedNetworksConfig",
- (_message.Message,),
- dict(
- CidrBlock=_reflection.GeneratedProtocolMessageType(
- "CidrBlock",
- (_message.Message,),
- dict(
- DESCRIPTOR=_MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""CidrBlock contains an optional name and one CIDR block.
- Attributes:
- display_name:
- display\_name is an optional field for users to identify CIDR
- blocks.
- cidr_block:
- cidr\_block must be specified in CIDR notation.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock)
- ),
- ),
- DESCRIPTOR=_MASTERAUTHORIZEDNETWORKSCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration options for the master authorized networks feature.
- Enabled master authorized networks will disallow all external traffic
- to access Kubernetes master through HTTPS except traffic from the
- given CIDR blocks, Google Compute Engine Public IPs and Google Prod
- IPs.
- Attributes:
- enabled:
- Whether or not master authorized networks is enabled.
- cidr_blocks:
- cidr\_blocks define up to 50 external networks that could
- access Kubernetes master through HTTPS.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.MasterAuthorizedNetworksConfig)
- ),
-)
-_sym_db.RegisterMessage(MasterAuthorizedNetworksConfig)
-_sym_db.RegisterMessage(MasterAuthorizedNetworksConfig.CidrBlock)
-
-LegacyAbac = _reflection.GeneratedProtocolMessageType(
- "LegacyAbac",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LEGACYABAC,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for the legacy Attribute Based Access Control
- authorization mode.
- Attributes:
- enabled:
- Whether the ABAC authorizer is enabled for this cluster. When
- enabled, identities in the system, including service accounts,
- nodes, and controllers, will have statically granted
- permissions beyond those provided by the RBAC configuration or
- IAM.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.LegacyAbac)
- ),
-)
-_sym_db.RegisterMessage(LegacyAbac)
-
-NetworkPolicy = _reflection.GeneratedProtocolMessageType(
- "NetworkPolicy",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NETWORKPOLICY,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration options for the NetworkPolicy feature.
- https://kubernetes.io/docs/concepts/services-
- networking/networkpolicies/
- Attributes:
- provider:
- The selected network policy provider.
- enabled:
- Whether network policy is enabled on the cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NetworkPolicy)
- ),
-)
-_sym_db.RegisterMessage(NetworkPolicy)
-
-BinaryAuthorization = _reflection.GeneratedProtocolMessageType(
- "BinaryAuthorization",
- (_message.Message,),
- dict(
- DESCRIPTOR=_BINARYAUTHORIZATION,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for Binary Authorization.
- Attributes:
- enabled:
- Enable Binary Authorization for this cluster. If enabled, all
- container images will be validated by Binary Authorization.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.BinaryAuthorization)
- ),
-)
-_sym_db.RegisterMessage(BinaryAuthorization)
-
-IPAllocationPolicy = _reflection.GeneratedProtocolMessageType(
- "IPAllocationPolicy",
- (_message.Message,),
- dict(
- DESCRIPTOR=_IPALLOCATIONPOLICY,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for controlling how IPs are allocated in the cluster.
- Attributes:
- use_ip_aliases:
- Whether alias IPs will be used for pod IPs in the cluster.
- create_subnetwork:
- Whether a new subnetwork will be created automatically for the
- cluster. This field is only applicable when
- ``use_ip_aliases`` is true.
- subnetwork_name:
- A custom subnetwork name to be used if ``create_subnetwork``
- is true. If this field is empty, then an automatic name will
- be chosen for the new subnetwork.
- cluster_ipv4_cidr:
- This field is deprecated, use cluster\_ipv4\_cidr\_block.
- node_ipv4_cidr:
- This field is deprecated, use node\_ipv4\_cidr\_block.
- services_ipv4_cidr:
- This field is deprecated, use services\_ipv4\_cidr\_block.
- cluster_secondary_range_name:
- The name of the secondary range to be used for the cluster
- CIDR block. The secondary range will be used for pod IP
- addresses. This must be an existing secondary range associated
- with the cluster subnetwork. This field is only applicable
- with use\_ip\_aliases is true and create\_subnetwork is false.
- services_secondary_range_name:
- The name of the secondary range to be used as for the services
- CIDR block. The secondary range will be used for service
- ClusterIPs. This must be an existing secondary range
- associated with the cluster subnetwork. This field is only
- applicable with use\_ip\_aliases is true and
- create\_subnetwork is false.
- cluster_ipv4_cidr_block:
- The IP address range for the cluster pod IPs. If this field is
- set, then ``cluster.cluster_ipv4_cidr`` must be left blank.
- This field is only applicable when ``use_ip_aliases`` is true.
- Set to blank to have a range chosen with the default size.
- Set to /netmask (e.g. ``/14``) to have a range chosen with a
- specific netmask. Set to a `CIDR
- `__ notation (e.g. ``10.96.0.0/14``) from the
- RFC-1918 private networks (e.g. ``10.0.0.0/8``,
- ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific
- range to use.
- node_ipv4_cidr_block:
- The IP address range of the instance IPs in this cluster.
- This is applicable only if ``create_subnetwork`` is true. Set
- to blank to have a range chosen with the default size. Set to
- /netmask (e.g. ``/14``) to have a range chosen with a specific
- netmask. Set to a `CIDR
- `__ notation (e.g. ``10.96.0.0/14``) from the
- RFC-1918 private networks (e.g. ``10.0.0.0/8``,
- ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific
- range to use.
- services_ipv4_cidr_block:
- The IP address range of the services IPs in this cluster. If
- blank, a range will be automatically chosen with the default
- size. This field is only applicable when ``use_ip_aliases``
- is true. Set to blank to have a range chosen with the default
- size. Set to /netmask (e.g. ``/14``) to have a range chosen
- with a specific netmask. Set to a `CIDR
- `__ notation (e.g. ``10.96.0.0/14``) from the
- RFC-1918 private networks (e.g. ``10.0.0.0/8``,
- ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific
- range to use.
- tpu_ipv4_cidr_block:
- The IP address range of the Cloud TPUs in this cluster. If
- unspecified, a range will be automatically chosen with the
- default size. This field is only applicable when
- ``use_ip_aliases`` is true. If unspecified, the range will
- use the default size. Set to /netmask (e.g. ``/14``) to have
- a range chosen with a specific netmask. Set to a `CIDR
- `__ notation (e.g. ``10.96.0.0/14``) from the
- RFC-1918 private networks (e.g. ``10.0.0.0/8``,
- ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific
- range to use.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.IPAllocationPolicy)
- ),
-)
-_sym_db.RegisterMessage(IPAllocationPolicy)
-
-Cluster = _reflection.GeneratedProtocolMessageType(
- "Cluster",
- (_message.Message,),
- dict(
- ResourceLabelsEntry=_reflection.GeneratedProtocolMessageType(
- "ResourceLabelsEntry",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CLUSTER_RESOURCELABELSENTRY,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2"
- # @@protoc_insertion_point(class_scope:google.container.v1.Cluster.ResourceLabelsEntry)
- ),
- ),
- DESCRIPTOR=_CLUSTER,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""A Google Kubernetes Engine cluster.
- Attributes:
- name:
- The name of this cluster. The name must be unique within this
- project and location (e.g. zone or region), and can be up to
- 40 characters with the following restrictions: - Lowercase
- letters, numbers, and hyphens only. - Must start with a
- letter. - Must end with a number or a letter.
- description:
- An optional description of this cluster.
- initial_node_count:
- The number of nodes to create in this cluster. You must ensure
- that your Compute Engine resource quota is sufficient for this
- number of instances. You must also have available firewall and
- routes quota. For requests, this field should only be used in
- lieu of a "node\_pool" object, since this configuration (along
- with the "node\_config") will be used to create a "NodePool"
- object with an auto-generated name. Do not use this and a
- node\_pool at the same time. This field is deprecated, use
- node\_pool.initial\_node\_count instead.
- node_config:
- Parameters used in creating the cluster's nodes. For requests,
- this field should only be used in lieu of a "node\_pool"
- object, since this configuration (along with the
- "initial\_node\_count") will be used to create a "NodePool"
- object with an auto-generated name. Do not use this and a
- node\_pool at the same time. For responses, this field will be
- populated with the node configuration of the first node pool.
- (For configuration of each node pool, see
- ``node_pool.config``) If unspecified, the defaults are used.
- This field is deprecated, use node\_pool.config instead.
- master_auth:
- The authentication information for accessing the master
- endpoint. If unspecified, the defaults are used: For clusters
- before v1.12, if master\_auth is unspecified, ``username``
- will be set to "admin", a random password will be generated,
- and a client certificate will be issued.
- logging_service:
- The logging service the cluster should use to write logs.
- Currently available options: -
- "logging.googleapis.com/kubernetes" - the Google Cloud Logging
- service with Kubernetes-native resource model -
- ``logging.googleapis.com`` - the Google Cloud Logging service.
- - ``none`` - no logs will be exported from the cluster. - if
- left as an empty string,\ ``logging.googleapis.com`` will be
- used.
- monitoring_service:
- The monitoring service the cluster should use to write
- metrics. Currently available options: -
- ``monitoring.googleapis.com`` - the Google Cloud Monitoring
- service. - ``none`` - no metrics will be exported from the
- cluster. - if left as an empty string,
- ``monitoring.googleapis.com`` will be used.
- network:
- The name of the Google Compute Engine `network
- `__ to which the cluster is connected. If
- left unspecified, the ``default`` network will be used.
- cluster_ipv4_cidr:
- The IP address range of the container pods in this cluster, in
- `CIDR `__ notation (e.g. ``10.96.0.0/14``). Leave
- blank to have one automatically chosen or specify a ``/14``
- block in ``10.0.0.0/8``.
- addons_config:
- Configurations for the various addons available to run in the
- cluster.
- subnetwork:
- The name of the Google Compute Engine `subnetwork
- `__ to
- which the cluster is connected.
- node_pools:
- The node pools associated with this cluster. This field should
- not be set if "node\_config" or "initial\_node\_count" are
- specified.
- locations:
- The list of Google Compute Engine `zones
- `__ in
- which the cluster's nodes should be located.
- enable_kubernetes_alpha:
- Kubernetes alpha features are enabled on this cluster. This
- includes alpha API groups (e.g. v1alpha1) and features that
- may not be production ready in the kubernetes version of the
- master and nodes. The cluster has no SLA for uptime and
- master/node upgrades are disabled. Alpha enabled clusters are
- automatically deleted thirty days after creation.
- resource_labels:
- The resource labels for the cluster to use to annotate any
- related Google Compute Engine resources.
- label_fingerprint:
- The fingerprint of the set of labels for this cluster.
- legacy_abac:
- Configuration for the legacy ABAC authorization mode.
- network_policy:
- Configuration options for the NetworkPolicy feature.
- ip_allocation_policy:
- Configuration for cluster IP allocation.
- master_authorized_networks_config:
- The configuration options for master authorized networks
- feature.
- maintenance_policy:
- Configure the maintenance policy for this cluster.
- binary_authorization:
- Configuration for Binary Authorization.
- autoscaling:
- Cluster-level autoscaling configuration.
- network_config:
- Configuration for cluster networking.
- default_max_pods_constraint:
- The default constraint on the maximum number of pods that can
- be run simultaneously on a node in the node pool of this
- cluster. Only honored if cluster created with IP Alias
- support.
- resource_usage_export_config:
- Configuration for exporting resource usages. Resource usage
- export is disabled when this config is unspecified.
- authenticator_groups_config:
- Configuration controlling RBAC group membership information.
- private_cluster_config:
- Configuration for private cluster.
- database_encryption:
- Configuration of etcd encryption.
- vertical_pod_autoscaling:
- Cluster-level Vertical Pod Autoscaling configuration.
- self_link:
- [Output only] Server-defined URL for the resource.
- zone:
- [Output only] The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field is deprecated, use
- location instead.
- endpoint:
- [Output only] The IP address of this cluster's master
- endpoint. The endpoint can be accessed from the internet at
- ``https://username:password@endpoint/``. See the
- ``masterAuth`` property of this resource for username and
- password information.
- initial_cluster_version:
- The initial Kubernetes version for this cluster. Valid
- versions are those found in validMasterVersions returned by
- getServerConfig. The version can be upgraded over time; such
- upgrades are reflected in currentMasterVersion and
- currentNodeVersion. Users may specify either explicit
- versions offered by Kubernetes Engine or version aliases,
- which have the following behavior: - "latest": picks the
- highest valid Kubernetes version - "1.X": picks the highest
- valid patch+gke.N patch in the 1.X version - "1.X.Y": picks
- the highest valid gke.N patch in the 1.X.Y version -
- "1.X.Y-gke.N": picks an explicit Kubernetes version - "","-":
- picks the default Kubernetes version
- current_master_version:
- [Output only] The current software version of the master
- endpoint.
- current_node_version:
- [Output only] Deprecated, use `NodePools.version
- `__ instead. The
- current version of the node software components. If they are
- currently at multiple versions because they're in the process
- of being upgraded, this reflects the minimum version of all
- nodes.
- create_time:
- [Output only] The time the cluster was created, in `RFC3339
- `__ text format.
- status:
- [Output only] The current status of this cluster.
- status_message:
- [Output only] Additional information about the current status
- of this cluster, if available.
- node_ipv4_cidr_size:
- [Output only] The size of the address space on each node for
- hosting containers. This is provisioned from within the
- ``container_ipv4_cidr`` range. This field will only be set
- when cluster is in route-based network mode.
- services_ipv4_cidr:
- [Output only] The IP address range of the Kubernetes services
- in this cluster, in `CIDR
- `__ notation (e.g. ``1.2.3.4/29``). Service
- addresses are typically put in the last ``/16`` from the
- container CIDR.
- instance_group_urls:
- Deprecated. Use node\_pools.instance\_group\_urls.
- current_node_count:
- [Output only] The number of nodes currently in the cluster.
- Deprecated. Call Kubernetes API directly to retrieve node
- information.
- expire_time:
- [Output only] The time the cluster will be automatically
- deleted in `RFC3339 `__
- text format.
- location:
- [Output only] The name of the Google Compute Engine `zone
- `__ or `region
- `__ in which the cluster resides.
- enable_tpu:
- Enable the ability to use Cloud TPUs in this cluster.
- tpu_ipv4_cidr_block:
- [Output only] The IP address range of the Cloud TPUs in this
- cluster, in `CIDR
- `__ notation (e.g. ``1.2.3.4/29``).
- conditions:
- Which conditions caused the current cluster state.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.Cluster)
- ),
-)
-_sym_db.RegisterMessage(Cluster)
-_sym_db.RegisterMessage(Cluster.ResourceLabelsEntry)
-
-ClusterUpdate = _reflection.GeneratedProtocolMessageType(
- "ClusterUpdate",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CLUSTERUPDATE,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ClusterUpdate describes an update to the cluster. Exactly one update
- can be applied to a cluster with each request, so at most one field
- can be provided.
- Attributes:
- desired_node_version:
- The Kubernetes version to change the nodes to (typically an
- upgrade). Users may specify either explicit versions offered
- by Kubernetes Engine or version aliases, which have the
- following behavior: - "latest": picks the highest valid
- Kubernetes version - "1.X": picks the highest valid
- patch+gke.N patch in the 1.X version - "1.X.Y": picks the
- highest valid gke.N patch in the 1.X.Y version -
- "1.X.Y-gke.N": picks an explicit Kubernetes version - "-":
- picks the Kubernetes master version
- desired_monitoring_service:
- The monitoring service the cluster should use to write
- metrics. Currently available options: -
- "monitoring.googleapis.com/kubernetes" - the Google Cloud
- Monitoring service with Kubernetes-native resource model -
- "monitoring.googleapis.com" - the Google Cloud Monitoring
- service - "none" - no metrics will be exported from the
- cluster
- desired_addons_config:
- Configurations for the various addons available to run in the
- cluster.
- desired_node_pool_id:
- The node pool to be upgraded. This field is mandatory if
- "desired\_node\_version", "desired\_image\_family" or
- "desired\_node\_pool\_autoscaling" is specified and there is
- more than one node pool on the cluster.
- desired_image_type:
- The desired image type for the node pool. NOTE: Set the
- "desired\_node\_pool" field as well.
- desired_database_encryption:
- Configuration of etcd encryption.
- desired_node_pool_autoscaling:
- Autoscaler configuration for the node pool specified in
- desired\_node\_pool\_id. If there is only one pool in the
- cluster and desired\_node\_pool\_id is not provided then the
- change applies to that single node pool.
- desired_locations:
- The desired list of Google Compute Engine `zones
- `__ in
- which the cluster's nodes should be located. Changing the
- locations a cluster is in will result in nodes being either
- created or removed from the cluster, depending on whether
- locations are being added or removed. This list must always
- include the cluster's primary zone.
- desired_master_authorized_networks_config:
- The desired configuration options for master authorized
- networks feature.
- desired_cluster_autoscaling:
- Cluster-level autoscaling configuration.
- desired_binary_authorization:
- The desired configuration options for the Binary Authorization
- feature.
- desired_logging_service:
- The logging service the cluster should use to write logs.
- Currently available options: -
- "logging.googleapis.com/kubernetes" - the Google Cloud Logging
- service with Kubernetes-native resource model -
- "logging.googleapis.com" - the Google Cloud Logging service -
- "none" - no logs will be exported from the cluster
- desired_resource_usage_export_config:
- The desired configuration for exporting resource usage.
- desired_vertical_pod_autoscaling:
- Cluster-level Vertical Pod Autoscaling configuration.
- desired_intra_node_visibility_config:
- The desired config of Intra-node visibility.
- desired_master_version:
- The Kubernetes version to change the master to. Users may
- specify either explicit versions offered by Kubernetes Engine
- or version aliases, which have the following behavior: -
- "latest": picks the highest valid Kubernetes version - "1.X":
- picks the highest valid patch+gke.N patch in the 1.X version -
- "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y
- version - "1.X.Y-gke.N": picks an explicit Kubernetes version
- - "-": picks the default Kubernetes version
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ClusterUpdate)
- ),
-)
-_sym_db.RegisterMessage(ClusterUpdate)
-
-Operation = _reflection.GeneratedProtocolMessageType(
- "Operation",
- (_message.Message,),
- dict(
- DESCRIPTOR=_OPERATION,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""This operation resource represents operations that may have happened
- or are happening on the cluster. All fields are output only.
- Attributes:
- name:
- The server-assigned ID for the operation.
- zone:
- The name of the Google Compute Engine `zone
- `__ in
- which the operation is taking place. This field is deprecated,
- use location instead.
- operation_type:
- The operation type.
- status:
- The current status of the operation.
- detail:
- Detailed operation progress, if available.
- status_message:
- If an error has occurred, a textual description of the error.
- self_link:
- Server-defined URL for the resource.
- target_link:
- Server-defined URL for the target of the operation.
- location:
- [Output only] The name of the Google Compute Engine `zone
- `__ or `region
- `__ in which the cluster resides.
- start_time:
- [Output only] The time the operation started, in `RFC3339
- `__ text format.
- end_time:
- [Output only] The time the operation completed, in `RFC3339
- `__ text format.
- cluster_conditions:
- Which conditions caused the current cluster state.
- nodepool_conditions:
- Which conditions caused the current node pool state.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.Operation)
- ),
-)
-_sym_db.RegisterMessage(Operation)
-
-CreateClusterRequest = _reflection.GeneratedProtocolMessageType(
- "CreateClusterRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CREATECLUSTERREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""CreateClusterRequest creates a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the parent field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the parent field.
- cluster:
- Required. A `cluster resource
- `__
- parent:
- The parent (project and location) where the cluster will be
- created. Specified in the format ``projects/*/locations/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.CreateClusterRequest)
- ),
-)
-_sym_db.RegisterMessage(CreateClusterRequest)
-
-GetClusterRequest = _reflection.GeneratedProtocolMessageType(
- "GetClusterRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_GETCLUSTERREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""GetClusterRequest gets the settings of a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to retrieve. This field
- has been deprecated and replaced by the name field.
- name:
- The name (project, location, cluster) of the cluster to
- retrieve. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.GetClusterRequest)
- ),
-)
-_sym_db.RegisterMessage(GetClusterRequest)
-
-UpdateClusterRequest = _reflection.GeneratedProtocolMessageType(
- "UpdateClusterRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_UPDATECLUSTERREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""UpdateClusterRequest updates the settings of a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- update:
- Required. A description of the update.
- name:
- The name (project, location, cluster) of the cluster to
- update. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.UpdateClusterRequest)
- ),
-)
-_sym_db.RegisterMessage(UpdateClusterRequest)
-
-UpdateNodePoolRequest = _reflection.GeneratedProtocolMessageType(
- "UpdateNodePoolRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_UPDATENODEPOOLREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""UpdateNodePoolRequests update a node pool's image and/or version.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool to upgrade. This field
- has been deprecated and replaced by the name field.
- node_version:
- Required. The Kubernetes version to change the nodes to
- (typically an upgrade). Users may specify either explicit
- versions offered by Kubernetes Engine or version aliases,
- which have the following behavior: - "latest": picks the
- highest valid Kubernetes version - "1.X": picks the highest
- valid patch+gke.N patch in the 1.X version - "1.X.Y": picks
- the highest valid gke.N patch in the 1.X.Y version -
- "1.X.Y-gke.N": picks an explicit Kubernetes version - "-":
- picks the Kubernetes master version
- image_type:
- Required. The desired image type for the node pool.
- name:
- The name (project, location, cluster, node pool) of the node
- pool to update. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.UpdateNodePoolRequest)
- ),
-)
-_sym_db.RegisterMessage(UpdateNodePoolRequest)
-
-SetNodePoolAutoscalingRequest = _reflection.GeneratedProtocolMessageType(
- "SetNodePoolAutoscalingRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETNODEPOOLAUTOSCALINGREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetNodePoolAutoscalingRequest sets the autoscaler settings of a node
- pool.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool to upgrade. This field
- has been deprecated and replaced by the name field.
- autoscaling:
- Required. Autoscaling configuration for the node pool.
- name:
- The name (project, location, cluster, node pool) of the node
- pool to set autoscaler settings. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetNodePoolAutoscalingRequest)
- ),
-)
-_sym_db.RegisterMessage(SetNodePoolAutoscalingRequest)
-
-SetLoggingServiceRequest = _reflection.GeneratedProtocolMessageType(
- "SetLoggingServiceRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETLOGGINGSERVICEREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetLoggingServiceRequest sets the logging service of a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- logging_service:
- Required. The logging service the cluster should use to write
- metrics. Currently available options: -
- "logging.googleapis.com" - the Google Cloud Logging service -
- "none" - no metrics will be exported from the cluster
- name:
- The name (project, location, cluster) of the cluster to set
- logging. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetLoggingServiceRequest)
- ),
-)
-_sym_db.RegisterMessage(SetLoggingServiceRequest)
-
-SetMonitoringServiceRequest = _reflection.GeneratedProtocolMessageType(
- "SetMonitoringServiceRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETMONITORINGSERVICEREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetMonitoringServiceRequest sets the monitoring service of a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- monitoring_service:
- Required. The monitoring service the cluster should use to
- write metrics. Currently available options: -
- "monitoring.googleapis.com/kubernetes" - the Google Cloud
- Monitoring service with Kubernetes-native resource model -
- "monitoring.googleapis.com" - the Google Cloud Monitoring
- service - "none" - no metrics will be exported from the
- cluster
- name:
- The name (project, location, cluster) of the cluster to set
- monitoring. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetMonitoringServiceRequest)
- ),
-)
-_sym_db.RegisterMessage(SetMonitoringServiceRequest)
-
-SetAddonsConfigRequest = _reflection.GeneratedProtocolMessageType(
- "SetAddonsConfigRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETADDONSCONFIGREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetAddonsConfigRequest sets the addons associated with the cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- addons_config:
- Required. The desired configurations for the various addons
- available to run in the cluster.
- name:
- The name (project, location, cluster) of the cluster to set
- addons. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetAddonsConfigRequest)
- ),
-)
-_sym_db.RegisterMessage(SetAddonsConfigRequest)
-
-SetLocationsRequest = _reflection.GeneratedProtocolMessageType(
- "SetLocationsRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETLOCATIONSREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetLocationsRequest sets the locations of the cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- locations:
- Required. The desired list of Google Compute Engine `zones
- `__ in
- which the cluster's nodes should be located. Changing the
- locations a cluster is in will result in nodes being either
- created or removed from the cluster, depending on whether
- locations are being added or removed. This list must always
- include the cluster's primary zone.
- name:
- The name (project, location, cluster) of the cluster to set
- locations. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetLocationsRequest)
- ),
-)
-_sym_db.RegisterMessage(SetLocationsRequest)
-
-UpdateMasterRequest = _reflection.GeneratedProtocolMessageType(
- "UpdateMasterRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_UPDATEMASTERREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""UpdateMasterRequest updates the master of the cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- master_version:
- Required. The Kubernetes version to change the master to.
- Users may specify either explicit versions offered by
- Kubernetes Engine or version aliases, which have the following
- behavior: - "latest": picks the highest valid Kubernetes
- version - "1.X": picks the highest valid patch+gke.N patch in
- the 1.X version - "1.X.Y": picks the highest valid gke.N
- patch in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit
- Kubernetes version - "-": picks the default Kubernetes
- version
- name:
- The name (project, location, cluster) of the cluster to
- update. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.UpdateMasterRequest)
- ),
-)
-_sym_db.RegisterMessage(UpdateMasterRequest)
-
-SetMasterAuthRequest = _reflection.GeneratedProtocolMessageType(
- "SetMasterAuthRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETMASTERAUTHREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetMasterAuthRequest updates the admin password of a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to upgrade. This field has
- been deprecated and replaced by the name field.
- action:
- Required. The exact form of action to be taken on the master
- auth.
- update:
- Required. A description of the update.
- name:
- The name (project, location, cluster) of the cluster to set
- auth. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetMasterAuthRequest)
- ),
-)
-_sym_db.RegisterMessage(SetMasterAuthRequest)
-
-DeleteClusterRequest = _reflection.GeneratedProtocolMessageType(
- "DeleteClusterRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_DELETECLUSTERREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""DeleteClusterRequest deletes a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to delete. This field has
- been deprecated and replaced by the name field.
- name:
- The name (project, location, cluster) of the cluster to
- delete. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.DeleteClusterRequest)
- ),
-)
-_sym_db.RegisterMessage(DeleteClusterRequest)
-
-ListClustersRequest = _reflection.GeneratedProtocolMessageType(
- "ListClustersRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTCLUSTERSREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListClustersRequest lists clusters.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the parent field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides, or "-" for all zones. This field
- has been deprecated and replaced by the parent field.
- parent:
- The parent (project and location) where the clusters will be
- listed. Specified in the format ``projects/*/locations/*``.
- Location "-" matches all zones and all regions.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListClustersRequest)
- ),
-)
-_sym_db.RegisterMessage(ListClustersRequest)
-
-ListClustersResponse = _reflection.GeneratedProtocolMessageType(
- "ListClustersResponse",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTCLUSTERSRESPONSE,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListClustersResponse is the result of ListClustersRequest.
- Attributes:
- clusters:
- A list of clusters in the project in the specified zone, or
- across all ones.
- missing_zones:
- If any zones are listed here, the list of clusters returned
- may be missing those zones.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListClustersResponse)
- ),
-)
-_sym_db.RegisterMessage(ListClustersResponse)
-
-GetOperationRequest = _reflection.GeneratedProtocolMessageType(
- "GetOperationRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_GETOPERATIONREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""GetOperationRequest gets a single operation.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- operation_id:
- Deprecated. The server-assigned ``name`` of the operation.
- This field has been deprecated and replaced by the name field.
- name:
- The name (project, location, operation id) of the operation to
- get. Specified in the format
- ``projects/*/locations/*/operations/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.GetOperationRequest)
- ),
-)
-_sym_db.RegisterMessage(GetOperationRequest)
-
-ListOperationsRequest = _reflection.GeneratedProtocolMessageType(
- "ListOperationsRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTOPERATIONSREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListOperationsRequest lists operations.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the parent field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ to
- return operations for, or ``-`` for all zones. This field has
- been deprecated and replaced by the parent field.
- parent:
- The parent (project and location) where the operations will be
- listed. Specified in the format ``projects/*/locations/*``.
- Location "-" matches all zones and all regions.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListOperationsRequest)
- ),
-)
-_sym_db.RegisterMessage(ListOperationsRequest)
-
-CancelOperationRequest = _reflection.GeneratedProtocolMessageType(
- "CancelOperationRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CANCELOPERATIONREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""CancelOperationRequest cancels a single operation.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the operation resides. This field has been deprecated
- and replaced by the name field.
- operation_id:
- Deprecated. The server-assigned ``name`` of the operation.
- This field has been deprecated and replaced by the name field.
- name:
- The name (project, location, operation id) of the operation to
- cancel. Specified in the format
- ``projects/*/locations/*/operations/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.CancelOperationRequest)
- ),
-)
-_sym_db.RegisterMessage(CancelOperationRequest)
-
-ListOperationsResponse = _reflection.GeneratedProtocolMessageType(
- "ListOperationsResponse",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTOPERATIONSRESPONSE,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListOperationsResponse is the result of ListOperationsRequest.
- Attributes:
- operations:
- A list of operations in the project in the specified zone.
- missing_zones:
- If any zones are listed here, the list of operations returned
- may be missing the operations from those zones.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListOperationsResponse)
- ),
-)
-_sym_db.RegisterMessage(ListOperationsResponse)
-
-GetServerConfigRequest = _reflection.GeneratedProtocolMessageType(
- "GetServerConfigRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_GETSERVERCONFIGREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Gets the current Kubernetes Engine service configuration.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ to
- return operations for. This field has been deprecated and
- replaced by the name field.
- name:
- The name (project and location) of the server config to get,
- specified in the format ``projects/*/locations/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.GetServerConfigRequest)
- ),
-)
-_sym_db.RegisterMessage(GetServerConfigRequest)
-
-ServerConfig = _reflection.GeneratedProtocolMessageType(
- "ServerConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SERVERCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Kubernetes Engine service configuration.
- Attributes:
- default_cluster_version:
- Version of Kubernetes the service deploys by default.
- valid_node_versions:
- List of valid node upgrade target versions.
- default_image_type:
- Default image type.
- valid_image_types:
- List of valid image types.
- valid_master_versions:
- List of valid master versions.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ServerConfig)
- ),
-)
-_sym_db.RegisterMessage(ServerConfig)
-
-CreateNodePoolRequest = _reflection.GeneratedProtocolMessageType(
- "CreateNodePoolRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CREATENODEPOOLREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""CreateNodePoolRequest creates a node pool for a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the parent field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the parent field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the parent field.
- node_pool:
- Required. The node pool to create.
- parent:
- The parent (project, location, cluster id) where the node pool
- will be created. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.CreateNodePoolRequest)
- ),
-)
-_sym_db.RegisterMessage(CreateNodePoolRequest)
-
-DeleteNodePoolRequest = _reflection.GeneratedProtocolMessageType(
- "DeleteNodePoolRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_DELETENODEPOOLREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""DeleteNodePoolRequest deletes a node pool for a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool to delete. This field
- has been deprecated and replaced by the name field.
- name:
- The name (project, location, cluster, node pool id) of the
- node pool to delete. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.DeleteNodePoolRequest)
- ),
-)
-_sym_db.RegisterMessage(DeleteNodePoolRequest)
-
-ListNodePoolsRequest = _reflection.GeneratedProtocolMessageType(
- "ListNodePoolsRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTNODEPOOLSREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListNodePoolsRequest lists the node pool(s) for a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the parent field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the parent field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the parent field.
- parent:
- The parent (project, location, cluster id) where the node
- pools will be listed. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListNodePoolsRequest)
- ),
-)
-_sym_db.RegisterMessage(ListNodePoolsRequest)
-
-GetNodePoolRequest = _reflection.GeneratedProtocolMessageType(
- "GetNodePoolRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_GETNODEPOOLREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""GetNodePoolRequest retrieves a node pool for a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool. This field has been
- deprecated and replaced by the name field.
- name:
- The name (project, location, cluster, node pool id) of the
- node pool to get. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.GetNodePoolRequest)
- ),
-)
-_sym_db.RegisterMessage(GetNodePoolRequest)
-
-NodePool = _reflection.GeneratedProtocolMessageType(
- "NodePool",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NODEPOOL,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""NodePool contains the name and configuration for a cluster's node
- pool. Node pools are a set of nodes (i.e. VM's), with a common
- configuration and specification, under the control of the cluster
- master. They may have a set of Kubernetes labels applied to them,
- which may be used to reference them during pod scheduling. They may
- also be resized up or down, to accommodate the workload.
- Attributes:
- name:
- The name of the node pool.
- config:
- The node configuration of the pool.
- initial_node_count:
- The initial node count for the pool. You must ensure that your
- Compute Engine resource quota is sufficient for this number of
- instances. You must also have available firewall and routes
- quota.
- self_link:
- [Output only] Server-defined URL for the resource.
- version:
- The version of the Kubernetes of this node.
- instance_group_urls:
- [Output only] The resource URLs of the `managed instance
- groups `__ associated
- with this node pool.
- status:
- [Output only] The status of the nodes in this pool instance.
- status_message:
- [Output only] Additional information about the current status
- of this node pool instance, if available.
- autoscaling:
- Autoscaler configuration for this NodePool. Autoscaler is
- enabled only if a valid configuration is present.
- management:
- NodeManagement configuration for this NodePool.
- max_pods_constraint:
- The constraint on the maximum number of pods that can be run
- simultaneously on a node in the node pool.
- conditions:
- Which conditions caused the current node pool state.
- pod_ipv4_cidr_size:
- [Output only] The pod CIDR block size per node in this node
- pool.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NodePool)
- ),
-)
-_sym_db.RegisterMessage(NodePool)
-
-NodeManagement = _reflection.GeneratedProtocolMessageType(
- "NodeManagement",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NODEMANAGEMENT,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""NodeManagement defines the set of node management services turned on
- for the node pool.
- Attributes:
- auto_upgrade:
- A flag that specifies whether node auto-upgrade is enabled for
- the node pool. If enabled, node auto-upgrade helps keep the
- nodes in your node pool up to date with the latest release
- version of Kubernetes.
- auto_repair:
- A flag that specifies whether the node auto-repair is enabled
- for the node pool. If enabled, the nodes in this node pool
- will be monitored and, if they fail health checks too many
- times, an automatic repair action will be triggered.
- upgrade_options:
- Specifies the Auto Upgrade knobs for the node pool.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NodeManagement)
- ),
-)
-_sym_db.RegisterMessage(NodeManagement)
-
-AutoUpgradeOptions = _reflection.GeneratedProtocolMessageType(
- "AutoUpgradeOptions",
- (_message.Message,),
- dict(
- DESCRIPTOR=_AUTOUPGRADEOPTIONS,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""AutoUpgradeOptions defines the set of options for the user to control
- how the Auto Upgrades will proceed.
- Attributes:
- auto_upgrade_start_time:
- [Output only] This field is set when upgrades are about to
- commence with the approximate start time for the upgrades, in
- `RFC3339 `__ text
- format.
- description:
- [Output only] This field is set when upgrades are about to
- commence with the description of the upgrade.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.AutoUpgradeOptions)
- ),
-)
-_sym_db.RegisterMessage(AutoUpgradeOptions)
-
-MaintenancePolicy = _reflection.GeneratedProtocolMessageType(
- "MaintenancePolicy",
- (_message.Message,),
- dict(
- DESCRIPTOR=_MAINTENANCEPOLICY,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""MaintenancePolicy defines the maintenance policy to be used for the
- cluster.
- Attributes:
- window:
- Specifies the maintenance window in which maintenance may be
- performed.
- resource_version:
- A hash identifying the version of this policy, so that updates
- to fields of the policy won't accidentally undo intermediate
- changes (and so that users of the API unaware of some fields
- won't accidentally remove other fields). Make a get() request
- to the cluster to get the current resource version and include
- it with requests to set the policy.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.MaintenancePolicy)
- ),
-)
-_sym_db.RegisterMessage(MaintenancePolicy)
-
-MaintenanceWindow = _reflection.GeneratedProtocolMessageType(
- "MaintenanceWindow",
- (_message.Message,),
- dict(
- MaintenanceExclusionsEntry=_reflection.GeneratedProtocolMessageType(
- "MaintenanceExclusionsEntry",
- (_message.Message,),
- dict(
- DESCRIPTOR=_MAINTENANCEWINDOW_MAINTENANCEEXCLUSIONSENTRY,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2"
- # @@protoc_insertion_point(class_scope:google.container.v1.MaintenanceWindow.MaintenanceExclusionsEntry)
- ),
- ),
- DESCRIPTOR=_MAINTENANCEWINDOW,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""MaintenanceWindow defines the maintenance window to be used for the
- cluster.
- Attributes:
- daily_maintenance_window:
- DailyMaintenanceWindow specifies a daily maintenance operation
- window.
- recurring_window:
- RecurringWindow specifies some number of recurring time
- periods for maintenance to occur. The time windows may be
- overlapping. If no maintenance windows are set, maintenance
- can occur at any time.
- maintenance_exclusions:
- Exceptions to maintenance window. Non-emergency maintenance
- should not occur in these windows.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.MaintenanceWindow)
- ),
-)
-_sym_db.RegisterMessage(MaintenanceWindow)
-_sym_db.RegisterMessage(MaintenanceWindow.MaintenanceExclusionsEntry)
-
-TimeWindow = _reflection.GeneratedProtocolMessageType(
- "TimeWindow",
- (_message.Message,),
- dict(
- DESCRIPTOR=_TIMEWINDOW,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Represents an arbitrary window of time.
- Attributes:
- start_time:
- The time that the window first starts.
- end_time:
- The time that the window ends. The end time should take place
- after the start time.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.TimeWindow)
- ),
-)
-_sym_db.RegisterMessage(TimeWindow)
-
-RecurringTimeWindow = _reflection.GeneratedProtocolMessageType(
- "RecurringTimeWindow",
- (_message.Message,),
- dict(
- DESCRIPTOR=_RECURRINGTIMEWINDOW,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Represents an arbitrary window of time that recurs.
- Attributes:
- window:
- The window of the first recurrence.
- recurrence:
- An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3)
- for how this window reccurs. They go on for the span of time
- between the start and end time. For example, to have
- something repeat every weekday, you'd use:
- FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR To repeat some window daily
- (equivalent to the DailyMaintenanceWindow): FREQ=DAILY For the
- first weekend of every month:
- FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU This specifies how
- frequently the window starts. Eg, if you wanted to have a 9-5
- UTC-4 window every weekday, you'd use something like: start
- time = 2019-01-01T09:00:00-0400 end time =
- 2019-01-01T17:00:00-0400 recurrence =
- FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR Windows can span multiple
- days. Eg, to make the window encompass every weekend from
- midnight Saturday till the last minute of Sunday UTC: start
- time = 2019-01-05T00:00:00Z end time = 2019-01-07T23:59:00Z
- recurrence = FREQ=WEEKLY;BYDAY=SA Note the start and end
- time's specific dates are largely arbitrary except to specify
- duration of the window and when it first starts. The FREQ
- values of HOURLY, MINUTELY, and SECONDLY are not supported.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.RecurringTimeWindow)
- ),
-)
-_sym_db.RegisterMessage(RecurringTimeWindow)
-
-DailyMaintenanceWindow = _reflection.GeneratedProtocolMessageType(
- "DailyMaintenanceWindow",
- (_message.Message,),
- dict(
- DESCRIPTOR=_DAILYMAINTENANCEWINDOW,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Time window specified for daily maintenance operations.
- Attributes:
- start_time:
- Time within the maintenance window to start the maintenance
- operations. Time format should be in `RFC3339
- `__ format "HH:MM",
- where HH : [00-23] and MM : [00-59] GMT.
- duration:
- [Output only] Duration of the time window, automatically
- chosen to be smallest possible in the given scenario. Duration
- will be in `RFC3339 `__
- format "PTnHnMnS".
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.DailyMaintenanceWindow)
- ),
-)
-_sym_db.RegisterMessage(DailyMaintenanceWindow)
-
-SetNodePoolManagementRequest = _reflection.GeneratedProtocolMessageType(
- "SetNodePoolManagementRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETNODEPOOLMANAGEMENTREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetNodePoolManagementRequest sets the node management properties of a
- node pool.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to update. This field has
- been deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool to update. This field
- has been deprecated and replaced by the name field.
- management:
- Required. NodeManagement configuration for the node pool.
- name:
- The name (project, location, cluster, node pool id) of the
- node pool to set management properties. Specified in the
- format ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetNodePoolManagementRequest)
- ),
-)
-_sym_db.RegisterMessage(SetNodePoolManagementRequest)
-
-SetNodePoolSizeRequest = _reflection.GeneratedProtocolMessageType(
- "SetNodePoolSizeRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETNODEPOOLSIZEREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetNodePoolSizeRequest sets the size a node pool.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to update. This field has
- been deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool to update. This field
- has been deprecated and replaced by the name field.
- node_count:
- Required. The desired node count for the pool.
- name:
- The name (project, location, cluster, node pool id) of the
- node pool to set size. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetNodePoolSizeRequest)
- ),
-)
-_sym_db.RegisterMessage(SetNodePoolSizeRequest)
-
-RollbackNodePoolUpgradeRequest = _reflection.GeneratedProtocolMessageType(
- "RollbackNodePoolUpgradeRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_ROLLBACKNODEPOOLUPGRADEREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or
- Failed NodePool upgrade. This will be an no-op if the last upgrade
- successfully completed.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to rollback. This field
- has been deprecated and replaced by the name field.
- node_pool_id:
- Deprecated. The name of the node pool to rollback. This field
- has been deprecated and replaced by the name field.
- name:
- The name (project, location, cluster, node pool id) of the
- node poll to rollback upgrade. Specified in the format
- ``projects/*/locations/*/clusters/*/nodePools/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.RollbackNodePoolUpgradeRequest)
- ),
-)
-_sym_db.RegisterMessage(RollbackNodePoolUpgradeRequest)
-
-ListNodePoolsResponse = _reflection.GeneratedProtocolMessageType(
- "ListNodePoolsResponse",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTNODEPOOLSRESPONSE,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListNodePoolsResponse is the result of ListNodePoolsRequest.
- Attributes:
- node_pools:
- A list of node pools for a cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListNodePoolsResponse)
- ),
-)
-_sym_db.RegisterMessage(ListNodePoolsResponse)
-
-ClusterAutoscaling = _reflection.GeneratedProtocolMessageType(
- "ClusterAutoscaling",
- (_message.Message,),
- dict(
- DESCRIPTOR=_CLUSTERAUTOSCALING,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ClusterAutoscaling contains global, per-cluster information required
- by Cluster Autoscaler to automatically adjust the size of the cluster
- and create/delete node pools based on the current needs.
- Attributes:
- enable_node_autoprovisioning:
- Enables automatic node pool creation and deletion.
- resource_limits:
- Contains global constraints regarding minimum and maximum
- amount of resources in the cluster.
- autoprovisioning_node_pool_defaults:
- AutoprovisioningNodePoolDefaults contains defaults for a node
- pool created by NAP.
- autoprovisioning_locations:
- The list of Google Compute Engine `zones
- `__ in
- which the NodePool's nodes can be created by NAP.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ClusterAutoscaling)
- ),
-)
-_sym_db.RegisterMessage(ClusterAutoscaling)
-
-AutoprovisioningNodePoolDefaults = _reflection.GeneratedProtocolMessageType(
- "AutoprovisioningNodePoolDefaults",
- (_message.Message,),
- dict(
- DESCRIPTOR=_AUTOPROVISIONINGNODEPOOLDEFAULTS,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""AutoprovisioningNodePoolDefaults contains defaults for a node pool
- created by NAP.
- Attributes:
- oauth_scopes:
- Scopes that are used by NAP when creating node pools. If
- oauth\_scopes are specified, service\_account should be empty.
- service_account:
- The Google Cloud Platform Service Account to be used by the
- node VMs. If service\_account is specified, scopes should be
- empty.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.AutoprovisioningNodePoolDefaults)
- ),
-)
-_sym_db.RegisterMessage(AutoprovisioningNodePoolDefaults)
-
-ResourceLimit = _reflection.GeneratedProtocolMessageType(
- "ResourceLimit",
- (_message.Message,),
- dict(
- DESCRIPTOR=_RESOURCELIMIT,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Contains information about amount of some resource in the cluster. For
- memory, value should be in GB.
- Attributes:
- resource_type:
- Resource name "cpu", "memory" or gpu-specific string.
- minimum:
- Minimum amount of the resource in the cluster.
- maximum:
- Maximum amount of the resource in the cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ResourceLimit)
- ),
-)
-_sym_db.RegisterMessage(ResourceLimit)
-
-NodePoolAutoscaling = _reflection.GeneratedProtocolMessageType(
- "NodePoolAutoscaling",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NODEPOOLAUTOSCALING,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""NodePoolAutoscaling contains information required by cluster
- autoscaler to adjust the size of the node pool to the current cluster
- usage.
- Attributes:
- enabled:
- Is autoscaling enabled for this node pool.
- min_node_count:
- Minimum number of nodes in the NodePool. Must be >= 1 and <=
- max\_node\_count.
- max_node_count:
- Maximum number of nodes in the NodePool. Must be >=
- min\_node\_count. There has to enough quota to scale up the
- cluster.
- autoprovisioned:
- Can this node pool be deleted automatically.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NodePoolAutoscaling)
- ),
-)
-_sym_db.RegisterMessage(NodePoolAutoscaling)
-
-SetLabelsRequest = _reflection.GeneratedProtocolMessageType(
- "SetLabelsRequest",
- (_message.Message,),
- dict(
- ResourceLabelsEntry=_reflection.GeneratedProtocolMessageType(
- "ResourceLabelsEntry",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETLABELSREQUEST_RESOURCELABELSENTRY,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2"
- # @@protoc_insertion_point(class_scope:google.container.v1.SetLabelsRequest.ResourceLabelsEntry)
- ),
- ),
- DESCRIPTOR=_SETLABELSREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetLabelsRequest sets the Google Cloud Platform labels on a Google
- Container Engine cluster, which will in turn set them for Google
- Compute Engine resources used by that cluster
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the name field.
- resource_labels:
- Required. The labels to set for that cluster.
- label_fingerprint:
- Required. The fingerprint of the previous set of labels for
- this resource, used to detect conflicts. The fingerprint is
- initially generated by Kubernetes Engine and changes after
- every request to modify or update labels. You must always
- provide an up-to-date fingerprint hash when updating or
- changing labels. Make a get() request to the resource to get
- the latest fingerprint.
- name:
- The name (project, location, cluster id) of the cluster to set
- labels. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetLabelsRequest)
- ),
-)
-_sym_db.RegisterMessage(SetLabelsRequest)
-_sym_db.RegisterMessage(SetLabelsRequest.ResourceLabelsEntry)
-
-SetLegacyAbacRequest = _reflection.GeneratedProtocolMessageType(
- "SetLegacyAbacRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETLEGACYABACREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetLegacyAbacRequest enables or disables the ABAC authorization
- mechanism for a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number
- `__. This
- field has been deprecated and replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster to update. This field has
- been deprecated and replaced by the name field.
- enabled:
- Required. Whether ABAC authorization will be enabled in the
- cluster.
- name:
- The name (project, location, cluster id) of the cluster to set
- legacy abac. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetLegacyAbacRequest)
- ),
-)
-_sym_db.RegisterMessage(SetLegacyAbacRequest)
-
-StartIPRotationRequest = _reflection.GeneratedProtocolMessageType(
- "StartIPRotationRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_STARTIPROTATIONREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""StartIPRotationRequest creates a new IP for the cluster and then
- performs a node upgrade on each node pool to point to the new IP.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the name field.
- name:
- The name (project, location, cluster id) of the cluster to
- start IP rotation. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- rotate_credentials:
- Whether to rotate credentials during IP rotation.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.StartIPRotationRequest)
- ),
-)
-_sym_db.RegisterMessage(StartIPRotationRequest)
-
-CompleteIPRotationRequest = _reflection.GeneratedProtocolMessageType(
- "CompleteIPRotationRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_COMPLETEIPROTATIONREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""CompleteIPRotationRequest moves the cluster master back into single-IP
- mode.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the name field.
- name:
- The name (project, location, cluster id) of the cluster to
- complete IP rotation. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.CompleteIPRotationRequest)
- ),
-)
-_sym_db.RegisterMessage(CompleteIPRotationRequest)
-
-AcceleratorConfig = _reflection.GeneratedProtocolMessageType(
- "AcceleratorConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_ACCELERATORCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""AcceleratorConfig represents a Hardware Accelerator request.
- Attributes:
- accelerator_count:
- The number of the accelerator cards exposed to an instance.
- accelerator_type:
- The accelerator type resource name. List of supported
- accelerators `here
- `__
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.AcceleratorConfig)
- ),
-)
-_sym_db.RegisterMessage(AcceleratorConfig)
-
-SetNetworkPolicyRequest = _reflection.GeneratedProtocolMessageType(
- "SetNetworkPolicyRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETNETWORKPOLICYREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetNetworkPolicyRequest enables/disables network policy for a cluster.
- Attributes:
- project_id:
- Deprecated. The Google Developers Console `project ID or
- project number `__. This field has been deprecated and
- replaced by the name field.
- zone:
- Deprecated. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides. This field has been deprecated and
- replaced by the name field.
- cluster_id:
- Deprecated. The name of the cluster. This field has been
- deprecated and replaced by the name field.
- network_policy:
- Required. Configuration options for the NetworkPolicy feature.
- name:
- The name (project, location, cluster id) of the cluster to set
- networking policy. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetNetworkPolicyRequest)
- ),
-)
-_sym_db.RegisterMessage(SetNetworkPolicyRequest)
-
-SetMaintenancePolicyRequest = _reflection.GeneratedProtocolMessageType(
- "SetMaintenancePolicyRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_SETMAINTENANCEPOLICYREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""SetMaintenancePolicyRequest sets the maintenance policy for a cluster.
- Attributes:
- project_id:
- Required. The Google Developers Console `project ID or project
- number `__.
- zone:
- Required. The name of the Google Compute Engine `zone
- `__ in
- which the cluster resides.
- cluster_id:
- Required. The name of the cluster to update.
- maintenance_policy:
- Required. The maintenance policy to be set for the cluster. An
- empty field clears the existing maintenance policy.
- name:
- The name (project, location, cluster id) of the cluster to set
- maintenance policy. Specified in the format
- ``projects/*/locations/*/clusters/*``.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.SetMaintenancePolicyRequest)
- ),
-)
-_sym_db.RegisterMessage(SetMaintenancePolicyRequest)
-
-StatusCondition = _reflection.GeneratedProtocolMessageType(
- "StatusCondition",
- (_message.Message,),
- dict(
- DESCRIPTOR=_STATUSCONDITION,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""StatusCondition describes why a cluster or a node pool has a certain
- status (e.g., ERROR or DEGRADED).
- Attributes:
- code:
- Machine-friendly representation of the condition
- message:
- Human-friendly representation of the condition
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.StatusCondition)
- ),
-)
-_sym_db.RegisterMessage(StatusCondition)
-
-NetworkConfig = _reflection.GeneratedProtocolMessageType(
- "NetworkConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_NETWORKCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""NetworkConfig reports the relative names of network & subnetwork.
- Attributes:
- network:
- Output only. The relative name of the Google Compute Engine [n
- etwork][google.container.v1.NetworkConfig.network](https://clo
- ud.google.com/compute/docs/networks-and-firewalls#networks) to
- which the cluster is connected. Example: projects/my-
- project/global/networks/my-network
- subnetwork:
- Output only. The relative name of the Google Compute Engine
- `subnetwork `__ to
- which the cluster is connected. Example: projects/my-
- project/regions/us-central1/subnetworks/my-subnet
- enable_intra_node_visibility:
- Whether Intra-node visibility is enabled for this cluster.
- This makes same node pod to pod traffic visible for VPC
- network.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.NetworkConfig)
- ),
-)
-_sym_db.RegisterMessage(NetworkConfig)
-
-IntraNodeVisibilityConfig = _reflection.GeneratedProtocolMessageType(
- "IntraNodeVisibilityConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_INTRANODEVISIBILITYCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""IntraNodeVisibilityConfig contains the desired config of the intra-
- node visibility on this cluster.
- Attributes:
- enabled:
- Enables intra node visibility for this cluster.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.IntraNodeVisibilityConfig)
- ),
-)
-_sym_db.RegisterMessage(IntraNodeVisibilityConfig)
-
-MaxPodsConstraint = _reflection.GeneratedProtocolMessageType(
- "MaxPodsConstraint",
- (_message.Message,),
- dict(
- DESCRIPTOR=_MAXPODSCONSTRAINT,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Constraints applied to pods.
- Attributes:
- max_pods_per_node:
- Constraint enforced on the max num of pods per node.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.MaxPodsConstraint)
- ),
-)
-_sym_db.RegisterMessage(MaxPodsConstraint)
-
-DatabaseEncryption = _reflection.GeneratedProtocolMessageType(
- "DatabaseEncryption",
- (_message.Message,),
- dict(
- DESCRIPTOR=_DATABASEENCRYPTION,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration of etcd encryption.
- Attributes:
- state:
- Denotes the state of etcd encryption.
- key_name:
- Name of CloudKMS key to use for the encryption of secrets in
- etcd. Ex. projects/my-project/locations/global/keyRings/my-
- ring/cryptoKeys/my-key
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.DatabaseEncryption)
- ),
-)
-_sym_db.RegisterMessage(DatabaseEncryption)
-
-ListUsableSubnetworksRequest = _reflection.GeneratedProtocolMessageType(
- "ListUsableSubnetworksRequest",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTUSABLESUBNETWORKSREQUEST,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListUsableSubnetworksRequest requests the list of usable subnetworks
- available to a user for creating clusters.
- Attributes:
- parent:
- The parent project where subnetworks are usable. Specified in
- the format ``projects/*``.
- filter:
- Filtering currently only supports equality on the
- networkProjectId and must be in the form:
- "networkProjectId=[PROJECTID]", where ``networkProjectId`` is
- the project which owns the listed subnetworks. This defaults
- to the parent project ID.
- page_size:
- The max number of results per page that should be returned. If
- the number of available results is larger than ``page_size``,
- a ``next_page_token`` is returned which can be used to get the
- next page of results in subsequent requests. Acceptable values
- are 0 to 500, inclusive. (Default: 500)
- page_token:
- Specifies a page token to use. Set this to the nextPageToken
- returned by previous list requests to get the next page of
- results.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListUsableSubnetworksRequest)
- ),
-)
-_sym_db.RegisterMessage(ListUsableSubnetworksRequest)
-
-ListUsableSubnetworksResponse = _reflection.GeneratedProtocolMessageType(
- "ListUsableSubnetworksResponse",
- (_message.Message,),
- dict(
- DESCRIPTOR=_LISTUSABLESUBNETWORKSRESPONSE,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""ListUsableSubnetworksResponse is the response of
- ListUsableSubnetworksRequest.
- Attributes:
- subnetworks:
- A list of usable subnetworks in the specified network project.
- next_page_token:
- This token allows you to get the next page of results for list
- requests. If the number of results is larger than
- ``page_size``, use the ``next_page_token`` as a value for the
- query parameter ``page_token`` in the next request. The value
- will become empty when there are no more pages.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ListUsableSubnetworksResponse)
- ),
-)
-_sym_db.RegisterMessage(ListUsableSubnetworksResponse)
-
-UsableSubnetworkSecondaryRange = _reflection.GeneratedProtocolMessageType(
- "UsableSubnetworkSecondaryRange",
- (_message.Message,),
- dict(
- DESCRIPTOR=_USABLESUBNETWORKSECONDARYRANGE,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Secondary IP range of a usable subnetwork.
- Attributes:
- range_name:
- The name associated with this subnetwork secondary range, used
- when adding an alias IP range to a VM instance.
- ip_cidr_range:
- The range of IP addresses belonging to this subnetwork
- secondary range.
- status:
- This field is to determine the status of the secondary range
- programmably.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.UsableSubnetworkSecondaryRange)
- ),
-)
-_sym_db.RegisterMessage(UsableSubnetworkSecondaryRange)
-
-UsableSubnetwork = _reflection.GeneratedProtocolMessageType(
- "UsableSubnetwork",
- (_message.Message,),
- dict(
- DESCRIPTOR=_USABLESUBNETWORK,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Network Name. Example: projects/my-project/global/networks/my-network
- Attributes:
- subnetwork:
- Subnetwork Name. Example: projects/my-project/regions/us-
- central1/subnetworks/my-subnet
- ip_cidr_range:
- The range of internal addresses that are owned by this
- subnetwork.
- secondary_ip_ranges:
- Secondary IP ranges.
- status_message:
- A human readable status message representing the reasons for
- cases where the caller cannot use the secondary ranges under
- the subnet. For example if the secondary\_ip\_ranges is empty
- due to a permission issue, an insufficient permission message
- will be given by status\_message.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.UsableSubnetwork)
- ),
-)
-_sym_db.RegisterMessage(UsableSubnetwork)
-
-ResourceUsageExportConfig = _reflection.GeneratedProtocolMessageType(
- "ResourceUsageExportConfig",
- (_message.Message,),
- dict(
- BigQueryDestination=_reflection.GeneratedProtocolMessageType(
- "BigQueryDestination",
- (_message.Message,),
- dict(
- DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Parameters for using BigQuery as the destination of resource usage
- export.
- Attributes:
- dataset_id:
- The ID of a BigQuery Dataset.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ResourceUsageExportConfig.BigQueryDestination)
- ),
- ),
- ConsumptionMeteringConfig=_reflection.GeneratedProtocolMessageType(
- "ConsumptionMeteringConfig",
- (_message.Message,),
- dict(
- DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG_CONSUMPTIONMETERINGCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Parameters for controlling consumption metering.
- Attributes:
- enabled:
- Whether to enable consumption metering for this cluster. If
- enabled, a second BigQuery table will be created to hold
- resource consumption records.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ResourceUsageExportConfig.ConsumptionMeteringConfig)
- ),
- ),
- DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""Configuration for exporting cluster resource usages.
- Attributes:
- bigquery_destination:
- Configuration to use BigQuery as usage export destination.
- enable_network_egress_metering:
- Whether to enable network egress metering for this cluster. If
- enabled, a daemonset will be created in the cluster to meter
- network egress traffic.
- consumption_metering_config:
- Configuration to enable resource consumption metering.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.ResourceUsageExportConfig)
- ),
-)
-_sym_db.RegisterMessage(ResourceUsageExportConfig)
-_sym_db.RegisterMessage(ResourceUsageExportConfig.BigQueryDestination)
-_sym_db.RegisterMessage(ResourceUsageExportConfig.ConsumptionMeteringConfig)
-
-VerticalPodAutoscaling = _reflection.GeneratedProtocolMessageType(
- "VerticalPodAutoscaling",
- (_message.Message,),
- dict(
- DESCRIPTOR=_VERTICALPODAUTOSCALING,
- __module__="google.cloud.container_v1.proto.cluster_service_pb2",
- __doc__="""VerticalPodAutoscaling contains global, per-cluster information
- required by Vertical Pod Autoscaler to automatically adjust the
- resources of pods controlled by it.
- Attributes:
- enabled:
- Enables vertical pod autoscaling.
- """,
- # @@protoc_insertion_point(class_scope:google.container.v1.VerticalPodAutoscaling)
- ),
-)
-_sym_db.RegisterMessage(VerticalPodAutoscaling)
-
-
-DESCRIPTOR._options = None
-_NODECONFIG_METADATAENTRY._options = None
-_NODECONFIG_LABELSENTRY._options = None
-_ADDONSCONFIG.fields_by_name["kubernetes_dashboard"]._options = None
-_IPALLOCATIONPOLICY.fields_by_name["cluster_ipv4_cidr"]._options = None
-_IPALLOCATIONPOLICY.fields_by_name["node_ipv4_cidr"]._options = None
-_IPALLOCATIONPOLICY.fields_by_name["services_ipv4_cidr"]._options = None
-_CLUSTER_RESOURCELABELSENTRY._options = None
-_CLUSTER.fields_by_name["initial_node_count"]._options = None
-_CLUSTER.fields_by_name["node_config"]._options = None
-_CLUSTER.fields_by_name["zone"]._options = None
-_CLUSTER.fields_by_name["current_node_version"]._options = None
-_CLUSTER.fields_by_name["instance_group_urls"]._options = None
-_CLUSTER.fields_by_name["current_node_count"]._options = None
-_OPERATION.fields_by_name["zone"]._options = None
-_CREATECLUSTERREQUEST.fields_by_name["project_id"]._options = None
-_CREATECLUSTERREQUEST.fields_by_name["zone"]._options = None
-_CREATECLUSTERREQUEST.fields_by_name["cluster"]._options = None
-_GETCLUSTERREQUEST.fields_by_name["project_id"]._options = None
-_GETCLUSTERREQUEST.fields_by_name["zone"]._options = None
-_GETCLUSTERREQUEST.fields_by_name["cluster_id"]._options = None
-_UPDATECLUSTERREQUEST.fields_by_name["project_id"]._options = None
-_UPDATECLUSTERREQUEST.fields_by_name["zone"]._options = None
-_UPDATECLUSTERREQUEST.fields_by_name["cluster_id"]._options = None
-_UPDATECLUSTERREQUEST.fields_by_name["update"]._options = None
-_UPDATENODEPOOLREQUEST.fields_by_name["project_id"]._options = None
-_UPDATENODEPOOLREQUEST.fields_by_name["zone"]._options = None
-_UPDATENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None
-_UPDATENODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None
-_UPDATENODEPOOLREQUEST.fields_by_name["node_version"]._options = None
-_UPDATENODEPOOLREQUEST.fields_by_name["image_type"]._options = None
-_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["project_id"]._options = None
-_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["zone"]._options = None
-_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["cluster_id"]._options = None
-_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["node_pool_id"]._options = None
-_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["autoscaling"]._options = None
-_SETLOGGINGSERVICEREQUEST.fields_by_name["project_id"]._options = None
-_SETLOGGINGSERVICEREQUEST.fields_by_name["zone"]._options = None
-_SETLOGGINGSERVICEREQUEST.fields_by_name["cluster_id"]._options = None
-_SETLOGGINGSERVICEREQUEST.fields_by_name["logging_service"]._options = None
-_SETMONITORINGSERVICEREQUEST.fields_by_name["project_id"]._options = None
-_SETMONITORINGSERVICEREQUEST.fields_by_name["zone"]._options = None
-_SETMONITORINGSERVICEREQUEST.fields_by_name["cluster_id"]._options = None
-_SETMONITORINGSERVICEREQUEST.fields_by_name["monitoring_service"]._options = None
-_SETADDONSCONFIGREQUEST.fields_by_name["project_id"]._options = None
-_SETADDONSCONFIGREQUEST.fields_by_name["zone"]._options = None
-_SETADDONSCONFIGREQUEST.fields_by_name["cluster_id"]._options = None
-_SETADDONSCONFIGREQUEST.fields_by_name["addons_config"]._options = None
-_SETLOCATIONSREQUEST.fields_by_name["project_id"]._options = None
-_SETLOCATIONSREQUEST.fields_by_name["zone"]._options = None
-_SETLOCATIONSREQUEST.fields_by_name["cluster_id"]._options = None
-_SETLOCATIONSREQUEST.fields_by_name["locations"]._options = None
-_UPDATEMASTERREQUEST.fields_by_name["project_id"]._options = None
-_UPDATEMASTERREQUEST.fields_by_name["zone"]._options = None
-_UPDATEMASTERREQUEST.fields_by_name["cluster_id"]._options = None
-_UPDATEMASTERREQUEST.fields_by_name["master_version"]._options = None
-_SETMASTERAUTHREQUEST.fields_by_name["project_id"]._options = None
-_SETMASTERAUTHREQUEST.fields_by_name["zone"]._options = None
-_SETMASTERAUTHREQUEST.fields_by_name["cluster_id"]._options = None
-_SETMASTERAUTHREQUEST.fields_by_name["action"]._options = None
-_SETMASTERAUTHREQUEST.fields_by_name["update"]._options = None
-_DELETECLUSTERREQUEST.fields_by_name["project_id"]._options = None
-_DELETECLUSTERREQUEST.fields_by_name["zone"]._options = None
-_DELETECLUSTERREQUEST.fields_by_name["cluster_id"]._options = None
-_LISTCLUSTERSREQUEST.fields_by_name["project_id"]._options = None
-_LISTCLUSTERSREQUEST.fields_by_name["zone"]._options = None
-_GETOPERATIONREQUEST.fields_by_name["project_id"]._options = None
-_GETOPERATIONREQUEST.fields_by_name["zone"]._options = None
-_GETOPERATIONREQUEST.fields_by_name["operation_id"]._options = None
-_LISTOPERATIONSREQUEST.fields_by_name["project_id"]._options = None
-_LISTOPERATIONSREQUEST.fields_by_name["zone"]._options = None
-_CANCELOPERATIONREQUEST.fields_by_name["project_id"]._options = None
-_CANCELOPERATIONREQUEST.fields_by_name["zone"]._options = None
-_CANCELOPERATIONREQUEST.fields_by_name["operation_id"]._options = None
-_GETSERVERCONFIGREQUEST.fields_by_name["project_id"]._options = None
-_GETSERVERCONFIGREQUEST.fields_by_name["zone"]._options = None
-_CREATENODEPOOLREQUEST.fields_by_name["project_id"]._options = None
-_CREATENODEPOOLREQUEST.fields_by_name["zone"]._options = None
-_CREATENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None
-_CREATENODEPOOLREQUEST.fields_by_name["node_pool"]._options = None
-_DELETENODEPOOLREQUEST.fields_by_name["project_id"]._options = None
-_DELETENODEPOOLREQUEST.fields_by_name["zone"]._options = None
-_DELETENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None
-_DELETENODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None
-_LISTNODEPOOLSREQUEST.fields_by_name["project_id"]._options = None
-_LISTNODEPOOLSREQUEST.fields_by_name["zone"]._options = None
-_LISTNODEPOOLSREQUEST.fields_by_name["cluster_id"]._options = None
-_GETNODEPOOLREQUEST.fields_by_name["project_id"]._options = None
-_GETNODEPOOLREQUEST.fields_by_name["zone"]._options = None
-_GETNODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None
-_GETNODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None
-_MAINTENANCEWINDOW_MAINTENANCEEXCLUSIONSENTRY._options = None
-_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["project_id"]._options = None
-_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["zone"]._options = None
-_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["cluster_id"]._options = None
-_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["node_pool_id"]._options = None
-_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["management"]._options = None
-_SETNODEPOOLSIZEREQUEST.fields_by_name["project_id"]._options = None
-_SETNODEPOOLSIZEREQUEST.fields_by_name["zone"]._options = None
-_SETNODEPOOLSIZEREQUEST.fields_by_name["cluster_id"]._options = None
-_SETNODEPOOLSIZEREQUEST.fields_by_name["node_pool_id"]._options = None
-_SETNODEPOOLSIZEREQUEST.fields_by_name["node_count"]._options = None
-_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["project_id"]._options = None
-_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["zone"]._options = None
-_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["cluster_id"]._options = None
-_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["node_pool_id"]._options = None
-_SETLABELSREQUEST_RESOURCELABELSENTRY._options = None
-_SETLABELSREQUEST.fields_by_name["project_id"]._options = None
-_SETLABELSREQUEST.fields_by_name["zone"]._options = None
-_SETLABELSREQUEST.fields_by_name["cluster_id"]._options = None
-_SETLABELSREQUEST.fields_by_name["resource_labels"]._options = None
-_SETLABELSREQUEST.fields_by_name["label_fingerprint"]._options = None
-_SETLEGACYABACREQUEST.fields_by_name["project_id"]._options = None
-_SETLEGACYABACREQUEST.fields_by_name["zone"]._options = None
-_SETLEGACYABACREQUEST.fields_by_name["cluster_id"]._options = None
-_SETLEGACYABACREQUEST.fields_by_name["enabled"]._options = None
-_STARTIPROTATIONREQUEST.fields_by_name["project_id"]._options = None
-_STARTIPROTATIONREQUEST.fields_by_name["zone"]._options = None
-_STARTIPROTATIONREQUEST.fields_by_name["cluster_id"]._options = None
-_COMPLETEIPROTATIONREQUEST.fields_by_name["project_id"]._options = None
-_COMPLETEIPROTATIONREQUEST.fields_by_name["zone"]._options = None
-_COMPLETEIPROTATIONREQUEST.fields_by_name["cluster_id"]._options = None
-_SETNETWORKPOLICYREQUEST.fields_by_name["project_id"]._options = None
-_SETNETWORKPOLICYREQUEST.fields_by_name["zone"]._options = None
-_SETNETWORKPOLICYREQUEST.fields_by_name["cluster_id"]._options = None
-_SETNETWORKPOLICYREQUEST.fields_by_name["network_policy"]._options = None
-_SETMAINTENANCEPOLICYREQUEST.fields_by_name["project_id"]._options = None
-_SETMAINTENANCEPOLICYREQUEST.fields_by_name["zone"]._options = None
-_SETMAINTENANCEPOLICYREQUEST.fields_by_name["cluster_id"]._options = None
-_SETMAINTENANCEPOLICYREQUEST.fields_by_name["maintenance_policy"]._options = None
-
-_CLUSTERMANAGER = _descriptor.ServiceDescriptor(
- name="ClusterManager",
- full_name="google.container.v1.ClusterManager",
- file=DESCRIPTOR,
- index=0,
- serialized_options=_b(
- "\312A\030container.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform"
- ),
- serialized_start=15940,
- serialized_end=24726,
- methods=[
- _descriptor.MethodDescriptor(
- name="ListClusters",
- full_name="google.container.v1.ClusterManager.ListClusters",
- index=0,
- containing_service=None,
- input_type=_LISTCLUSTERSREQUEST,
- output_type=_LISTCLUSTERSRESPONSE,
- serialized_options=_b(
- "\202\323\344\223\002a\022,/v1/{parent=projects/*/locations/*}/clustersZ1\022//v1/projects/{project_id}/zones/{zone}/clusters\332A\017project_id,zone\332A\006parent"
- ),
- ),
- _descriptor.MethodDescriptor(
- name="GetCluster",
- full_name="google.container.v1.ClusterManager.GetCluster",
- index=1,
- containing_service=None,
- input_type=_GETCLUSTERREQUEST,
- output_type=_CLUSTER,
- serialized_options=_b(
- "\202\323\344\223\002n\022,/v1/{name=projects/*/locations/*/clusters/*}Z>\022*/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels:\001*ZP"K/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels:\001*'
- ),
- ),
- _descriptor.MethodDescriptor(
- name="SetLegacyAbac",
- full_name="google.container.v1.ClusterManager.SetLegacyAbac",
- index=24,
- containing_service=None,
- input_type=_SETLEGACYABACREQUEST,
- output_type=_OPERATION,
- serialized_options=_b(
- '\202\323\344\223\002\215\001":/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac:\001*ZL"G/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac:\001*\332A"project_id,zone,cluster_id,enabled\332A\014name,enabled'
- ),
- ),
- _descriptor.MethodDescriptor(
- name="StartIPRotation",
- full_name="google.container.v1.ClusterManager.StartIPRotation",
- index=25,
- containing_service=None,
- input_type=_STARTIPROTATIONREQUEST,
- output_type=_OPERATION,
- serialized_options=_b(
- '\202\323\344\223\002\224\001" None:
+ """Instantiate the cluster manager client.
+
+ Args:
+ credentials (Optional[google.auth.credentials.Credentials]): The
+ authorization credentials to attach to requests. These
+ credentials identify the application to the service; if none
+ are specified, the client will attempt to ascertain the
+ credentials from the environment.
+ transport (Union[str, ~.ClusterManagerTransport]): The
+ transport to use. If set to None, a transport is chosen
+ automatically.
+ client_options (ClientOptions): Custom options for the client. It
+ won't take effect if a ``transport`` instance is provided.
+ (1) The ``api_endpoint`` property can be used to override the
+ default endpoint provided by the client. GOOGLE_API_USE_MTLS
+ environment variable can also be used to override the endpoint:
+ "always" (always use the default mTLS endpoint), "never" (always
+ use the default regular endpoint, this is the default value for
+ the environment variable) and "auto" (auto switch to the default
+ mTLS endpoint if client SSL credentials is present). However,
+ the ``api_endpoint`` property takes precedence if provided.
+ (2) The ``client_cert_source`` property is used to provide client
+ SSL credentials for mutual TLS transport. If not provided, the
+ default SSL credentials will be used if present.
+
+ Raises:
+ google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
+ creation failed for any reason.
+ """
+
+ self._client = ClusterManagerClient(
+ credentials=credentials, transport=transport, client_options=client_options,
+ )
+
+ async def list_clusters(
+ self,
+ request: cluster_service.ListClustersRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListClustersResponse:
+ r"""Lists all clusters owned by a project in either the
+ specified zone or all zones.
+
+ Args:
+ request (:class:`~.cluster_service.ListClustersRequest`):
+ The request object. ListClustersRequest lists clusters.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides, or "-" for all zones. This
+ field has been deprecated and replaced by the parent
+ field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project and location) where the clusters
+ will be listed. Specified in the format
+ ``projects/*/locations/*``. Location "-" matches all
+ zones and all regions.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ListClustersResponse:
+ ListClustersResponse is the result of
+ ListClustersRequest.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, parent]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.ListClustersRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.list_clusters,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def get_cluster(
+ self,
+ request: cluster_service.GetClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Cluster:
+ r"""Gets the details of a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.GetClusterRequest`):
+ The request object. GetClusterRequest gets the settings
+ of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to retrieve. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ retrieve. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Cluster:
+ A Google Kubernetes Engine cluster.
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.get_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def create_cluster(
+ self,
+ request: cluster_service.CreateClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster: cluster_service.Cluster = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Creates a cluster, consisting of the specified number and type
+ of Google Compute Engine instances.
+
+ By default, the cluster is created in the project's `default
+ network `__.
+
+ One firewall is added for the cluster. After cluster creation,
+ the Kubelet creates routes for each node to allow the containers
+ on that node to communicate with all other instances in the
+ cluster.
+
+ Finally, an entry is added to the project's global metadata
+ indicating which CIDR range the cluster is using.
+
+ Args:
+ request (:class:`~.cluster_service.CreateClusterRequest`):
+ The request object. CreateClusterRequest creates a
+ cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the parent field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster (:class:`~.cluster_service.Cluster`):
+ Required. A `cluster
+ resource `__
+ This corresponds to the ``cluster`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project and location) where the cluster will
+ be created. Specified in the format
+ ``projects/*/locations/*``.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster, parent]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CreateClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster is not None:
+ request.cluster = cluster
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.create_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def update_cluster(
+ self,
+ request: cluster_service.UpdateClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ update: cluster_service.ClusterUpdate = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Updates the settings of a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.UpdateClusterRequest`):
+ The request object. UpdateClusterRequest updates the
+ settings of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ update (:class:`~.cluster_service.ClusterUpdate`):
+ Required. A description of the
+ update.
+ This corresponds to the ``update`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ update. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, update, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.UpdateClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if update is not None:
+ request.update = update
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.update_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def update_node_pool(
+ self,
+ request: cluster_service.UpdateNodePoolRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Updates the version and/or image type for the
+ specified node pool.
+
+ Args:
+ request (:class:`~.cluster_service.UpdateNodePoolRequest`):
+ The request object. UpdateNodePoolRequests update a node
+ pool's image and/or version.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.UpdateNodePoolRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.update_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_node_pool_autoscaling(
+ self,
+ request: cluster_service.SetNodePoolAutoscalingRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the autoscaling settings for the specified node
+ pool.
+
+ Args:
+ request (:class:`~.cluster_service.SetNodePoolAutoscalingRequest`):
+ The request object. SetNodePoolAutoscalingRequest sets
+ the autoscaler settings of a node pool.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetNodePoolAutoscalingRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_node_pool_autoscaling,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_logging_service(
+ self,
+ request: cluster_service.SetLoggingServiceRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ logging_service: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the logging service for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLoggingServiceRequest`):
+ The request object. SetLoggingServiceRequest sets the
+ logging service of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ logging_service (:class:`str`):
+ Required. The logging service the cluster should use to
+ write metrics. Currently available options:
+
+ - "logging.googleapis.com" - the Google Cloud Logging
+ service
+ - "none" - no metrics will be exported from the cluster
+ This corresponds to the ``logging_service`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set logging. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, logging_service, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetLoggingServiceRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if logging_service is not None:
+ request.logging_service = logging_service
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_logging_service,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_monitoring_service(
+ self,
+ request: cluster_service.SetMonitoringServiceRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ monitoring_service: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the monitoring service for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetMonitoringServiceRequest`):
+ The request object. SetMonitoringServiceRequest sets the
+ monitoring service of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ monitoring_service (:class:`str`):
+ Required. The monitoring service the cluster should use
+ to write metrics. Currently available options:
+
+ - "monitoring.googleapis.com/kubernetes" - the Google
+ Cloud Monitoring service with Kubernetes-native
+ resource model
+ - "monitoring.googleapis.com" - the Google Cloud
+ Monitoring service
+ - "none" - no metrics will be exported from the cluster
+ This corresponds to the ``monitoring_service`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set monitoring. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, monitoring_service, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetMonitoringServiceRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if monitoring_service is not None:
+ request.monitoring_service = monitoring_service
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_monitoring_service,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_addons_config(
+ self,
+ request: cluster_service.SetAddonsConfigRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ addons_config: cluster_service.AddonsConfig = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the addons for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetAddonsConfigRequest`):
+ The request object. SetAddonsConfigRequest sets the
+ addons associated with the cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ addons_config (:class:`~.cluster_service.AddonsConfig`):
+ Required. The desired configurations
+ for the various addons available to run
+ in the cluster.
+ This corresponds to the ``addons_config`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set addons. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, addons_config, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetAddonsConfigRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if addons_config is not None:
+ request.addons_config = addons_config
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_addons_config,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_locations(
+ self,
+ request: cluster_service.SetLocationsRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ locations: Sequence[str] = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the locations for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLocationsRequest`):
+ The request object. SetLocationsRequest sets the
+ locations of the cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ locations (:class:`Sequence[str]`):
+ Required. The desired list of Google Compute Engine
+ `zones `__
+ in which the cluster's nodes should be located. Changing
+ the locations a cluster is in will result in nodes being
+ either created or removed from the cluster, depending on
+ whether locations are being added or removed.
+
+ This list must always include the cluster's primary
+ zone.
+ This corresponds to the ``locations`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set locations. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, locations, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetLocationsRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if locations is not None:
+ request.locations = locations
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_locations,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def update_master(
+ self,
+ request: cluster_service.UpdateMasterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ master_version: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Updates the master for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.UpdateMasterRequest`):
+ The request object. UpdateMasterRequest updates the
+ master of the cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ master_version (:class:`str`):
+ Required. The Kubernetes version to
+ change the master to.
+ Users may specify either explicit
+ versions offered by Kubernetes Engine or
+ version aliases, which have the
+ following behavior:
+ - "latest": picks the highest valid
+ Kubernetes version - "1.X": picks the
+ highest valid patch+gke.N patch in the
+ 1.X version - "1.X.Y": picks the highest
+ valid gke.N patch in the 1.X.Y version -
+ "1.X.Y-gke.N": picks an explicit
+ Kubernetes version - "-": picks the
+ default Kubernetes version
+ This corresponds to the ``master_version`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ update. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, master_version, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.UpdateMasterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if master_version is not None:
+ request.master_version = master_version
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.update_master,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_master_auth(
+ self,
+ request: cluster_service.SetMasterAuthRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets master auth materials. Currently supports
+ changing the admin password or a specific cluster,
+ either via password generation or explicitly setting the
+ password.
+
+ Args:
+ request (:class:`~.cluster_service.SetMasterAuthRequest`):
+ The request object. SetMasterAuthRequest updates the
+ admin password of a cluster.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetMasterAuthRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_master_auth,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def delete_cluster(
+ self,
+ request: cluster_service.DeleteClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Deletes the cluster, including the Kubernetes
+ endpoint and all worker nodes.
+
+ Firewalls and routes that were configured during cluster
+ creation are also deleted.
+
+ Other Google Compute Engine resources that might be in
+ use by the cluster, such as load balancer resources, are
+ not deleted if they weren't present when the cluster was
+ initially created.
+
+ Args:
+ request (:class:`~.cluster_service.DeleteClusterRequest`):
+ The request object. DeleteClusterRequest deletes a
+ cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to delete. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ delete. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.DeleteClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.delete_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def list_operations(
+ self,
+ request: cluster_service.ListOperationsRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListOperationsResponse:
+ r"""Lists all operations in a project in a specific zone
+ or all zones.
+
+ Args:
+ request (:class:`~.cluster_service.ListOperationsRequest`):
+ The request object. ListOperationsRequest lists
+ operations.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ to return operations for, or ``-`` for all zones. This
+ field has been deprecated and replaced by the parent
+ field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ListOperationsResponse:
+ ListOperationsResponse is the result
+ of ListOperationsRequest.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.ListOperationsRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.list_operations,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def get_operation(
+ self,
+ request: cluster_service.GetOperationRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ operation_id: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Gets the specified operation.
+
+ Args:
+ request (:class:`~.cluster_service.GetOperationRequest`):
+ The request object. GetOperationRequest gets a single
+ operation.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ operation_id (:class:`str`):
+ Deprecated. The server-assigned ``name`` of the
+ operation. This field has been deprecated and replaced
+ by the name field.
+ This corresponds to the ``operation_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, operation_id]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetOperationRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if operation_id is not None:
+ request.operation_id = operation_id
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.get_operation,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def cancel_operation(
+ self,
+ request: cluster_service.CancelOperationRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ operation_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> None:
+ r"""Cancels the specified operation.
+
+ Args:
+ request (:class:`~.cluster_service.CancelOperationRequest`):
+ The request object. CancelOperationRequest cancels a
+ single operation.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the operation resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ operation_id (:class:`str`):
+ Deprecated. The server-assigned ``name`` of the
+ operation. This field has been deprecated and replaced
+ by the name field.
+ This corresponds to the ``operation_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, operation id) of the
+ operation to cancel. Specified in the format
+ ``projects/*/locations/*/operations/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, operation_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CancelOperationRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if operation_id is not None:
+ request.operation_id = operation_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.cancel_operation,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ await rpc(
+ request, retry=retry, timeout=timeout, metadata=metadata,
+ )
+
+ async def get_server_config(
+ self,
+ request: cluster_service.GetServerConfigRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ServerConfig:
+ r"""Returns configuration info about the Google
+ Kubernetes Engine service.
+
+ Args:
+ request (:class:`~.cluster_service.GetServerConfigRequest`):
+ The request object. Gets the current Kubernetes Engine
+ service configuration.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ to return operations for. This field has been deprecated
+ and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project and location) of the server config to
+ get, specified in the format ``projects/*/locations/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ServerConfig:
+ Kubernetes Engine service
+ configuration.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetServerConfigRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.get_server_config,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def list_node_pools(
+ self,
+ request: cluster_service.ListNodePoolsRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListNodePoolsResponse:
+ r"""Lists the node pools for a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.ListNodePoolsRequest`):
+ The request object. ListNodePoolsRequest lists the node
+ pool(s) for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the parent field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the parent field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project, location, cluster id) where the
+ node pools will be listed. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ListNodePoolsResponse:
+ ListNodePoolsResponse is the result
+ of ListNodePoolsRequest.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, parent]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.ListNodePoolsRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.list_node_pools,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def get_node_pool(
+ self,
+ request: cluster_service.GetNodePoolRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.NodePool:
+ r"""Retrieves the requested node pool.
+
+ Args:
+ request (:class:`~.cluster_service.GetNodePoolRequest`):
+ The request object. GetNodePoolRequest retrieves a node
+ pool for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool_id (:class:`str`):
+ Deprecated. The name of the node
+ pool. This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``node_pool_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster, node pool id) of
+ the node pool to get. Specified in the format
+ ``projects/*/locations/*/clusters/*/nodePools/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.NodePool:
+ NodePool contains the name and
+ configuration for a cluster's node pool.
+ Node pools are a set of nodes (i.e.
+ VM's), with a common configuration and
+ specification, under the control of the
+ cluster master. They may have a set of
+ Kubernetes labels applied to them, which
+ may be used to reference them during pod
+ scheduling. They may also be resized up
+ or down, to accommodate the workload.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool_id, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetNodePoolRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool_id is not None:
+ request.node_pool_id = node_pool_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.get_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def create_node_pool(
+ self,
+ request: cluster_service.CreateNodePoolRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool: cluster_service.NodePool = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Creates a node pool for a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.CreateNodePoolRequest`):
+ The request object. CreateNodePoolRequest creates a node
+ pool for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the parent field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the parent field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool (:class:`~.cluster_service.NodePool`):
+ Required. The node pool to create.
+ This corresponds to the ``node_pool`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project, location, cluster id) where the
+ node pool will be created. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool, parent]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CreateNodePoolRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool is not None:
+ request.node_pool = node_pool
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.create_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def delete_node_pool(
+ self,
+ request: cluster_service.DeleteNodePoolRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Deletes a node pool from a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.DeleteNodePoolRequest`):
+ The request object. DeleteNodePoolRequest deletes a node
+ pool for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool_id (:class:`str`):
+ Deprecated. The name of the node pool
+ to delete. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``node_pool_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster, node pool id) of
+ the node pool to delete. Specified in the format
+ ``projects/*/locations/*/clusters/*/nodePools/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool_id, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.DeleteNodePoolRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool_id is not None:
+ request.node_pool_id = node_pool_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.delete_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def rollback_node_pool_upgrade(
+ self,
+ request: cluster_service.RollbackNodePoolUpgradeRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Rolls back a previously Aborted or Failed NodePool
+ upgrade. This makes no changes if the last upgrade
+ successfully completed.
+
+ Args:
+ request (:class:`~.cluster_service.RollbackNodePoolUpgradeRequest`):
+ The request object. RollbackNodePoolUpgradeRequest
+ rollbacks the previously Aborted or Failed NodePool
+ upgrade. This will be an no-op if the last upgrade
+ successfully completed.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to rollback. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool_id (:class:`str`):
+ Deprecated. The name of the node pool
+ to rollback. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``node_pool_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster, node pool id) of
+ the node poll to rollback upgrade. Specified in the
+ format
+ ``projects/*/locations/*/clusters/*/nodePools/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool_id, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.RollbackNodePoolUpgradeRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool_id is not None:
+ request.node_pool_id = node_pool_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.rollback_node_pool_upgrade,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_node_pool_management(
+ self,
+ request: cluster_service.SetNodePoolManagementRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the NodeManagement options for a node pool.
+
+ Args:
+ request (:class:`~.cluster_service.SetNodePoolManagementRequest`):
+ The request object. SetNodePoolManagementRequest sets
+ the node management properties of a node pool.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetNodePoolManagementRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_node_pool_management,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_labels(
+ self,
+ request: cluster_service.SetLabelsRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets labels on a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLabelsRequest`):
+ The request object. SetLabelsRequest sets the Google
+ Cloud Platform labels on a Google Container Engine
+ cluster, which will in turn set them for Google Compute
+ Engine resources used by that cluster
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetLabelsRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_labels,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_legacy_abac(
+ self,
+ request: cluster_service.SetLegacyAbacRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ enabled: bool = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Enables or disables the ABAC authorization mechanism
+ on a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLegacyAbacRequest`):
+ The request object. SetLegacyAbacRequest enables or
+ disables the ABAC authorization mechanism for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to update. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ enabled (:class:`bool`):
+ Required. Whether ABAC authorization
+ will be enabled in the cluster.
+ This corresponds to the ``enabled`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster id) of the cluster
+ to set legacy abac. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, enabled, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetLegacyAbacRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if enabled is not None:
+ request.enabled = enabled
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_legacy_abac,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def start_ip_rotation(
+ self,
+ request: cluster_service.StartIPRotationRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Starts master IP rotation.
+
+ Args:
+ request (:class:`~.cluster_service.StartIPRotationRequest`):
+ The request object. StartIPRotationRequest creates a new
+ IP for the cluster and then performs a node upgrade on
+ each node pool to point to the new IP.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster id) of the cluster
+ to start IP rotation. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.StartIPRotationRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.start_ip_rotation,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def complete_ip_rotation(
+ self,
+ request: cluster_service.CompleteIPRotationRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Completes master IP rotation.
+
+ Args:
+ request (:class:`~.cluster_service.CompleteIPRotationRequest`):
+ The request object. CompleteIPRotationRequest moves the
+ cluster master back into single-IP mode.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster id) of the cluster
+ to complete IP rotation. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CompleteIPRotationRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.complete_ip_rotation,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_node_pool_size(
+ self,
+ request: cluster_service.SetNodePoolSizeRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the size for a specific node pool.
+
+ Args:
+ request (:class:`~.cluster_service.SetNodePoolSizeRequest`):
+ The request object. SetNodePoolSizeRequest sets the size
+ a node pool.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetNodePoolSizeRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_node_pool_size,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_network_policy(
+ self,
+ request: cluster_service.SetNetworkPolicyRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ network_policy: cluster_service.NetworkPolicy = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Enables or disables Network Policy for a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetNetworkPolicyRequest`):
+ The request object. SetNetworkPolicyRequest
+ enables/disables network policy for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ network_policy (:class:`~.cluster_service.NetworkPolicy`):
+ Required. Configuration options for
+ the NetworkPolicy feature.
+ This corresponds to the ``network_policy`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster id) of the cluster
+ to set networking policy. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, network_policy, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetNetworkPolicyRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if network_policy is not None:
+ request.network_policy = network_policy
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_network_policy,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def set_maintenance_policy(
+ self,
+ request: cluster_service.SetMaintenancePolicyRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ maintenance_policy: cluster_service.MaintenancePolicy = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the maintenance policy for a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetMaintenancePolicyRequest`):
+ The request object. SetMaintenancePolicyRequest sets the
+ maintenance policy for a cluster.
+ project_id (:class:`str`):
+ Required. The Google Developers Console `project ID or
+ project
+ number `__.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Required. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Required. The name of the cluster to
+ update.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ maintenance_policy (:class:`~.cluster_service.MaintenancePolicy`):
+ Required. The maintenance policy to
+ be set for the cluster. An empty field
+ clears the existing maintenance policy.
+ This corresponds to the ``maintenance_policy`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster id) of the cluster
+ to set maintenance policy. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, maintenance_policy, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetMaintenancePolicyRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if maintenance_policy is not None:
+ request.maintenance_policy = maintenance_policy
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.set_maintenance_policy,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def list_usable_subnetworks(
+ self,
+ request: cluster_service.ListUsableSubnetworksRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> pagers.ListUsableSubnetworksAsyncPager:
+ r"""Lists subnetworks that are usable for creating
+ clusters in a project.
+
+ Args:
+ request (:class:`~.cluster_service.ListUsableSubnetworksRequest`):
+ The request object. ListUsableSubnetworksRequest
+ requests the list of usable subnetworks available to a
+ user for creating clusters.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.pagers.ListUsableSubnetworksAsyncPager:
+ ListUsableSubnetworksResponse is the
+ response of
+ ListUsableSubnetworksRequest.
+
+ Iterating over this object will yield
+ results and resolve additional pages
+ automatically.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.ListUsableSubnetworksRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.list_usable_subnetworks,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # This method is paged; wrap the response in a pager, which provides
+ # an `__aiter__` convenience method.
+ response = pagers.ListUsableSubnetworksAsyncPager(
+ method=rpc, request=request, response=response, metadata=metadata,
+ )
+
+ # Done; return the response.
+ return response
+
+
+try:
+ _client_info = gapic_v1.client_info.ClientInfo(
+ gapic_version=pkg_resources.get_distribution("google-container",).version,
+ )
+except pkg_resources.DistributionNotFound:
+ _client_info = gapic_v1.client_info.ClientInfo()
+
+
+__all__ = ("ClusterManagerAsyncClient",)
diff --git a/google/cloud/container_v1/services/cluster_manager/client.py b/google/cloud/container_v1/services/cluster_manager/client.py
new file mode 100644
index 00000000..42e89bfb
--- /dev/null
+++ b/google/cloud/container_v1/services/cluster_manager/client.py
@@ -0,0 +1,3327 @@
+# -*- 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.
+#
+
+from collections import OrderedDict
+import os
+import re
+from typing import Callable, Dict, Sequence, Tuple, Type, Union
+import pkg_resources
+
+import google.api_core.client_options as ClientOptions # type: ignore
+from google.api_core import exceptions # type: ignore
+from google.api_core import gapic_v1 # type: ignore
+from google.api_core import retry as retries # type: ignore
+from google.auth import credentials # type: ignore
+from google.auth.transport import mtls # type: ignore
+from google.auth.exceptions import MutualTLSChannelError # type: ignore
+from google.oauth2 import service_account # type: ignore
+
+from google.cloud.container_v1.services.cluster_manager import pagers
+from google.cloud.container_v1.types import cluster_service
+
+from .transports.base import ClusterManagerTransport
+from .transports.grpc import ClusterManagerGrpcTransport
+from .transports.grpc_asyncio import ClusterManagerGrpcAsyncIOTransport
+
+
+class ClusterManagerClientMeta(type):
+ """Metaclass for the ClusterManager client.
+
+ This provides class-level methods for building and retrieving
+ support objects (e.g. transport) without polluting the client instance
+ objects.
+ """
+
+ _transport_registry = (
+ OrderedDict()
+ ) # type: Dict[str, Type[ClusterManagerTransport]]
+ _transport_registry["grpc"] = ClusterManagerGrpcTransport
+ _transport_registry["grpc_asyncio"] = ClusterManagerGrpcAsyncIOTransport
+
+ def get_transport_class(cls, label: str = None,) -> Type[ClusterManagerTransport]:
+ """Return an appropriate transport class.
+
+ Args:
+ label: The name of the desired transport. If none is
+ provided, then the first transport in the registry is used.
+
+ Returns:
+ The transport class to use.
+ """
+ # If a specific transport is requested, return that one.
+ if label:
+ return cls._transport_registry[label]
+
+ # No transport is requested; return the default (that is, the first one
+ # in the dictionary).
+ return next(iter(cls._transport_registry.values()))
+
+
+class ClusterManagerClient(metaclass=ClusterManagerClientMeta):
+ """Google Kubernetes Engine Cluster Manager v1"""
+
+ @staticmethod
+ def _get_default_mtls_endpoint(api_endpoint):
+ """Convert api endpoint to mTLS endpoint.
+ Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
+ "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
+ Args:
+ api_endpoint (Optional[str]): the api endpoint to convert.
+ Returns:
+ str: converted mTLS api endpoint.
+ """
+ if not api_endpoint:
+ return api_endpoint
+
+ mtls_endpoint_re = re.compile(
+ r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?"
+ )
+
+ m = mtls_endpoint_re.match(api_endpoint)
+ name, mtls, sandbox, googledomain = m.groups()
+ if mtls or not googledomain:
+ return api_endpoint
+
+ if sandbox:
+ return api_endpoint.replace(
+ "sandbox.googleapis.com", "mtls.sandbox.googleapis.com"
+ )
+
+ return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com")
+
+ DEFAULT_ENDPOINT = "container.googleapis.com"
+ DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
+ DEFAULT_ENDPOINT
+ )
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ {@api.name}: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_file(filename)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
+ from_service_account_json = from_service_account_file
+
+ def __init__(
+ self,
+ *,
+ credentials: credentials.Credentials = None,
+ transport: Union[str, ClusterManagerTransport] = None,
+ client_options: ClientOptions = None,
+ ) -> None:
+ """Instantiate the cluster manager client.
+
+ Args:
+ credentials (Optional[google.auth.credentials.Credentials]): The
+ authorization credentials to attach to requests. These
+ credentials identify the application to the service; if none
+ are specified, the client will attempt to ascertain the
+ credentials from the environment.
+ transport (Union[str, ~.ClusterManagerTransport]): The
+ transport to use. If set to None, a transport is chosen
+ automatically.
+ client_options (ClientOptions): Custom options for the client. It
+ won't take effect if a ``transport`` instance is provided.
+ (1) The ``api_endpoint`` property can be used to override the
+ default endpoint provided by the client. GOOGLE_API_USE_MTLS
+ environment variable can also be used to override the endpoint:
+ "always" (always use the default mTLS endpoint), "never" (always
+ use the default regular endpoint, this is the default value for
+ the environment variable) and "auto" (auto switch to the default
+ mTLS endpoint if client SSL credentials is present). However,
+ the ``api_endpoint`` property takes precedence if provided.
+ (2) The ``client_cert_source`` property is used to provide client
+ SSL credentials for mutual TLS transport. If not provided, the
+ default SSL credentials will be used if present.
+
+ Raises:
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
+ creation failed for any reason.
+ """
+ if isinstance(client_options, dict):
+ client_options = ClientOptions.from_dict(client_options)
+ if client_options is None:
+ client_options = ClientOptions.ClientOptions()
+
+ if client_options.api_endpoint is None:
+ use_mtls_env = os.getenv("GOOGLE_API_USE_MTLS", "never")
+ if use_mtls_env == "never":
+ client_options.api_endpoint = self.DEFAULT_ENDPOINT
+ elif use_mtls_env == "always":
+ client_options.api_endpoint = self.DEFAULT_MTLS_ENDPOINT
+ elif use_mtls_env == "auto":
+ has_client_cert_source = (
+ client_options.client_cert_source is not None
+ or mtls.has_default_client_cert_source()
+ )
+ client_options.api_endpoint = (
+ self.DEFAULT_MTLS_ENDPOINT
+ if has_client_cert_source
+ else self.DEFAULT_ENDPOINT
+ )
+ else:
+ raise MutualTLSChannelError(
+ "Unsupported GOOGLE_API_USE_MTLS value. Accepted values: never, auto, always"
+ )
+
+ # Save or instantiate the transport.
+ # Ordinarily, we provide the transport, but allowing a custom transport
+ # instance provides an extensibility point for unusual situations.
+ if isinstance(transport, ClusterManagerTransport):
+ # transport is a ClusterManagerTransport instance.
+ if credentials or client_options.credentials_file:
+ raise ValueError(
+ "When providing a transport instance, "
+ "provide its credentials directly."
+ )
+ if client_options.scopes:
+ raise ValueError(
+ "When providing a transport instance, "
+ "provide its scopes directly."
+ )
+ self._transport = transport
+ else:
+ Transport = type(self).get_transport_class(transport)
+ self._transport = Transport(
+ credentials=credentials,
+ credentials_file=client_options.credentials_file,
+ host=client_options.api_endpoint,
+ scopes=client_options.scopes,
+ api_mtls_endpoint=client_options.api_endpoint,
+ client_cert_source=client_options.client_cert_source,
+ )
+
+ def list_clusters(
+ self,
+ request: cluster_service.ListClustersRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListClustersResponse:
+ r"""Lists all clusters owned by a project in either the
+ specified zone or all zones.
+
+ Args:
+ request (:class:`~.cluster_service.ListClustersRequest`):
+ The request object. ListClustersRequest lists clusters.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides, or "-" for all zones. This
+ field has been deprecated and replaced by the parent
+ field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project and location) where the clusters
+ will be listed. Specified in the format
+ ``projects/*/locations/*``. Location "-" matches all
+ zones and all regions.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ListClustersResponse:
+ ListClustersResponse is the result of
+ ListClustersRequest.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, parent]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.ListClustersRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.list_clusters,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def get_cluster(
+ self,
+ request: cluster_service.GetClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Cluster:
+ r"""Gets the details of a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.GetClusterRequest`):
+ The request object. GetClusterRequest gets the settings
+ of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to retrieve. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ retrieve. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Cluster:
+ A Google Kubernetes Engine cluster.
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.get_cluster, default_timeout=None, client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def create_cluster(
+ self,
+ request: cluster_service.CreateClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster: cluster_service.Cluster = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Creates a cluster, consisting of the specified number and type
+ of Google Compute Engine instances.
+
+ By default, the cluster is created in the project's `default
+ network `__.
+
+ One firewall is added for the cluster. After cluster creation,
+ the Kubelet creates routes for each node to allow the containers
+ on that node to communicate with all other instances in the
+ cluster.
+
+ Finally, an entry is added to the project's global metadata
+ indicating which CIDR range the cluster is using.
+
+ Args:
+ request (:class:`~.cluster_service.CreateClusterRequest`):
+ The request object. CreateClusterRequest creates a
+ cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the parent field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster (:class:`~.cluster_service.Cluster`):
+ Required. A `cluster
+ resource `__
+ This corresponds to the ``cluster`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project and location) where the cluster will
+ be created. Specified in the format
+ ``projects/*/locations/*``.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster, parent]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CreateClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster is not None:
+ request.cluster = cluster
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.create_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def update_cluster(
+ self,
+ request: cluster_service.UpdateClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ update: cluster_service.ClusterUpdate = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Updates the settings of a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.UpdateClusterRequest`):
+ The request object. UpdateClusterRequest updates the
+ settings of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ update (:class:`~.cluster_service.ClusterUpdate`):
+ Required. A description of the
+ update.
+ This corresponds to the ``update`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ update. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, update, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.UpdateClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if update is not None:
+ request.update = update
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.update_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def update_node_pool(
+ self,
+ request: cluster_service.UpdateNodePoolRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Updates the version and/or image type for the
+ specified node pool.
+
+ Args:
+ request (:class:`~.cluster_service.UpdateNodePoolRequest`):
+ The request object. UpdateNodePoolRequests update a node
+ pool's image and/or version.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.UpdateNodePoolRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.update_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_node_pool_autoscaling(
+ self,
+ request: cluster_service.SetNodePoolAutoscalingRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the autoscaling settings for the specified node
+ pool.
+
+ Args:
+ request (:class:`~.cluster_service.SetNodePoolAutoscalingRequest`):
+ The request object. SetNodePoolAutoscalingRequest sets
+ the autoscaler settings of a node pool.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetNodePoolAutoscalingRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_node_pool_autoscaling,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_logging_service(
+ self,
+ request: cluster_service.SetLoggingServiceRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ logging_service: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the logging service for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLoggingServiceRequest`):
+ The request object. SetLoggingServiceRequest sets the
+ logging service of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ logging_service (:class:`str`):
+ Required. The logging service the cluster should use to
+ write metrics. Currently available options:
+
+ - "logging.googleapis.com" - the Google Cloud Logging
+ service
+ - "none" - no metrics will be exported from the cluster
+ This corresponds to the ``logging_service`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set logging. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, logging_service, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetLoggingServiceRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if logging_service is not None:
+ request.logging_service = logging_service
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_logging_service,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_monitoring_service(
+ self,
+ request: cluster_service.SetMonitoringServiceRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ monitoring_service: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the monitoring service for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetMonitoringServiceRequest`):
+ The request object. SetMonitoringServiceRequest sets the
+ monitoring service of a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ monitoring_service (:class:`str`):
+ Required. The monitoring service the cluster should use
+ to write metrics. Currently available options:
+
+ - "monitoring.googleapis.com/kubernetes" - the Google
+ Cloud Monitoring service with Kubernetes-native
+ resource model
+ - "monitoring.googleapis.com" - the Google Cloud
+ Monitoring service
+ - "none" - no metrics will be exported from the cluster
+ This corresponds to the ``monitoring_service`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set monitoring. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, monitoring_service, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetMonitoringServiceRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if monitoring_service is not None:
+ request.monitoring_service = monitoring_service
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_monitoring_service,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_addons_config(
+ self,
+ request: cluster_service.SetAddonsConfigRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ addons_config: cluster_service.AddonsConfig = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the addons for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetAddonsConfigRequest`):
+ The request object. SetAddonsConfigRequest sets the
+ addons associated with the cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ addons_config (:class:`~.cluster_service.AddonsConfig`):
+ Required. The desired configurations
+ for the various addons available to run
+ in the cluster.
+ This corresponds to the ``addons_config`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set addons. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, addons_config, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetAddonsConfigRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if addons_config is not None:
+ request.addons_config = addons_config
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_addons_config,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_locations(
+ self,
+ request: cluster_service.SetLocationsRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ locations: Sequence[str] = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the locations for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLocationsRequest`):
+ The request object. SetLocationsRequest sets the
+ locations of the cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ locations (:class:`Sequence[str]`):
+ Required. The desired list of Google Compute Engine
+ `zones `__
+ in which the cluster's nodes should be located. Changing
+ the locations a cluster is in will result in nodes being
+ either created or removed from the cluster, depending on
+ whether locations are being added or removed.
+
+ This list must always include the cluster's primary
+ zone.
+ This corresponds to the ``locations`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ set locations. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, locations, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.SetLocationsRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if locations is not None:
+ request.locations = locations
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_locations,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def update_master(
+ self,
+ request: cluster_service.UpdateMasterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ master_version: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Updates the master for a specific cluster.
+
+ Args:
+ request (:class:`~.cluster_service.UpdateMasterRequest`):
+ The request object. UpdateMasterRequest updates the
+ master of the cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to upgrade. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ master_version (:class:`str`):
+ Required. The Kubernetes version to
+ change the master to.
+ Users may specify either explicit
+ versions offered by Kubernetes Engine or
+ version aliases, which have the
+ following behavior:
+ - "latest": picks the highest valid
+ Kubernetes version - "1.X": picks the
+ highest valid patch+gke.N patch in the
+ 1.X version - "1.X.Y": picks the highest
+ valid gke.N patch in the 1.X.Y version -
+ "1.X.Y-gke.N": picks an explicit
+ Kubernetes version - "-": picks the
+ default Kubernetes version
+ This corresponds to the ``master_version`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ update. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, master_version, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.UpdateMasterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if master_version is not None:
+ request.master_version = master_version
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.update_master,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_master_auth(
+ self,
+ request: cluster_service.SetMasterAuthRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets master auth materials. Currently supports
+ changing the admin password or a specific cluster,
+ either via password generation or explicitly setting the
+ password.
+
+ Args:
+ request (:class:`~.cluster_service.SetMasterAuthRequest`):
+ The request object. SetMasterAuthRequest updates the
+ admin password of a cluster.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetMasterAuthRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_master_auth,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def delete_cluster(
+ self,
+ request: cluster_service.DeleteClusterRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Deletes the cluster, including the Kubernetes
+ endpoint and all worker nodes.
+
+ Firewalls and routes that were configured during cluster
+ creation are also deleted.
+
+ Other Google Compute Engine resources that might be in
+ use by the cluster, such as load balancer resources, are
+ not deleted if they weren't present when the cluster was
+ initially created.
+
+ Args:
+ request (:class:`~.cluster_service.DeleteClusterRequest`):
+ The request object. DeleteClusterRequest deletes a
+ cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to delete. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster) of the cluster to
+ delete. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.DeleteClusterRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.delete_cluster,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def list_operations(
+ self,
+ request: cluster_service.ListOperationsRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListOperationsResponse:
+ r"""Lists all operations in a project in a specific zone
+ or all zones.
+
+ Args:
+ request (:class:`~.cluster_service.ListOperationsRequest`):
+ The request object. ListOperationsRequest lists
+ operations.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ to return operations for, or ``-`` for all zones. This
+ field has been deprecated and replaced by the parent
+ field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ListOperationsResponse:
+ ListOperationsResponse is the result
+ of ListOperationsRequest.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.ListOperationsRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.list_operations,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def get_operation(
+ self,
+ request: cluster_service.GetOperationRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ operation_id: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Gets the specified operation.
+
+ Args:
+ request (:class:`~.cluster_service.GetOperationRequest`):
+ The request object. GetOperationRequest gets a single
+ operation.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ operation_id (:class:`str`):
+ Deprecated. The server-assigned ``name`` of the
+ operation. This field has been deprecated and replaced
+ by the name field.
+ This corresponds to the ``operation_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, operation_id]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetOperationRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if operation_id is not None:
+ request.operation_id = operation_id
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.get_operation,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def cancel_operation(
+ self,
+ request: cluster_service.CancelOperationRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ operation_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> None:
+ r"""Cancels the specified operation.
+
+ Args:
+ request (:class:`~.cluster_service.CancelOperationRequest`):
+ The request object. CancelOperationRequest cancels a
+ single operation.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the operation resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ operation_id (:class:`str`):
+ Deprecated. The server-assigned ``name`` of the
+ operation. This field has been deprecated and replaced
+ by the name field.
+ This corresponds to the ``operation_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, operation id) of the
+ operation to cancel. Specified in the format
+ ``projects/*/locations/*/operations/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, operation_id, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CancelOperationRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if operation_id is not None:
+ request.operation_id = operation_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.cancel_operation,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ rpc(
+ request, retry=retry, timeout=timeout, metadata=metadata,
+ )
+
+ def get_server_config(
+ self,
+ request: cluster_service.GetServerConfigRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ServerConfig:
+ r"""Returns configuration info about the Google
+ Kubernetes Engine service.
+
+ Args:
+ request (:class:`~.cluster_service.GetServerConfigRequest`):
+ The request object. Gets the current Kubernetes Engine
+ service configuration.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ to return operations for. This field has been deprecated
+ and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project and location) of the server config to
+ get, specified in the format ``projects/*/locations/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ServerConfig:
+ Kubernetes Engine service
+ configuration.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, name]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetServerConfigRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.get_server_config,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def list_node_pools(
+ self,
+ request: cluster_service.ListNodePoolsRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.ListNodePoolsResponse:
+ r"""Lists the node pools for a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.ListNodePoolsRequest`):
+ The request object. ListNodePoolsRequest lists the node
+ pool(s) for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the parent field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the parent field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project, location, cluster id) where the
+ node pools will be listed. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.ListNodePoolsResponse:
+ ListNodePoolsResponse is the result
+ of ListNodePoolsRequest.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any([project_id, zone, cluster_id, parent]):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.ListNodePoolsRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.list_node_pools,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def get_node_pool(
+ self,
+ request: cluster_service.GetNodePoolRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.NodePool:
+ r"""Retrieves the requested node pool.
+
+ Args:
+ request (:class:`~.cluster_service.GetNodePoolRequest`):
+ The request object. GetNodePoolRequest retrieves a node
+ pool for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool_id (:class:`str`):
+ Deprecated. The name of the node
+ pool. This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``node_pool_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster, node pool id) of
+ the node pool to get. Specified in the format
+ ``projects/*/locations/*/clusters/*/nodePools/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.NodePool:
+ NodePool contains the name and
+ configuration for a cluster's node pool.
+ Node pools are a set of nodes (i.e.
+ VM's), with a common configuration and
+ specification, under the control of the
+ cluster master. They may have a set of
+ Kubernetes labels applied to them, which
+ may be used to reference them during pod
+ scheduling. They may also be resized up
+ or down, to accommodate the workload.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool_id, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.GetNodePoolRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool_id is not None:
+ request.node_pool_id = node_pool_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.get_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def create_node_pool(
+ self,
+ request: cluster_service.CreateNodePoolRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool: cluster_service.NodePool = None,
+ parent: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Creates a node pool for a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.CreateNodePoolRequest`):
+ The request object. CreateNodePoolRequest creates a node
+ pool for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the
+ parent field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the parent field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the parent field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool (:class:`~.cluster_service.NodePool`):
+ Required. The node pool to create.
+ This corresponds to the ``node_pool`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ parent (:class:`str`):
+ The parent (project, location, cluster id) where the
+ node pool will be created. Specified in the format
+ ``projects/*/locations/*/clusters/*``.
+ This corresponds to the ``parent`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool, parent]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.CreateNodePoolRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool is not None:
+ request.node_pool = node_pool
+ if parent is not None:
+ request.parent = parent
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.create_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def delete_node_pool(
+ self,
+ request: cluster_service.DeleteNodePoolRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Deletes a node pool from a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.DeleteNodePoolRequest`):
+ The request object. DeleteNodePoolRequest deletes a node
+ pool for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster.
+ This field has been deprecated and
+ replaced by the name field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool_id (:class:`str`):
+ Deprecated. The name of the node pool
+ to delete. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``node_pool_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster, node pool id) of
+ the node pool to delete. Specified in the format
+ ``projects/*/locations/*/clusters/*/nodePools/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool_id, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.DeleteNodePoolRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool_id is not None:
+ request.node_pool_id = node_pool_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.delete_node_pool,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def rollback_node_pool_upgrade(
+ self,
+ request: cluster_service.RollbackNodePoolUpgradeRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ node_pool_id: str = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Rolls back a previously Aborted or Failed NodePool
+ upgrade. This makes no changes if the last upgrade
+ successfully completed.
+
+ Args:
+ request (:class:`~.cluster_service.RollbackNodePoolUpgradeRequest`):
+ The request object. RollbackNodePoolUpgradeRequest
+ rollbacks the previously Aborted or Failed NodePool
+ upgrade. This will be an no-op if the last upgrade
+ successfully completed.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number `__.
+ This field has been deprecated and replaced by the name
+ field.
+ This corresponds to the ``project_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ zone (:class:`str`):
+ Deprecated. The name of the Google Compute Engine
+ `zone `__
+ in which the cluster resides. This field has been
+ deprecated and replaced by the name field.
+ This corresponds to the ``zone`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ cluster_id (:class:`str`):
+ Deprecated. The name of the cluster
+ to rollback. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``cluster_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ node_pool_id (:class:`str`):
+ Deprecated. The name of the node pool
+ to rollback. This field has been
+ deprecated and replaced by the name
+ field.
+ This corresponds to the ``node_pool_id`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+ name (:class:`str`):
+ The name (project, location, cluster, node pool id) of
+ the node poll to rollback upgrade. Specified in the
+ format
+ ``projects/*/locations/*/clusters/*/nodePools/*``.
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ if request is not None and any(
+ [project_id, zone, cluster_id, node_pool_id, name]
+ ):
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = cluster_service.RollbackNodePoolUpgradeRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if project_id is not None:
+ request.project_id = project_id
+ if zone is not None:
+ request.zone = zone
+ if cluster_id is not None:
+ request.cluster_id = cluster_id
+ if node_pool_id is not None:
+ request.node_pool_id = node_pool_id
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.rollback_node_pool_upgrade,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_node_pool_management(
+ self,
+ request: cluster_service.SetNodePoolManagementRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets the NodeManagement options for a node pool.
+
+ Args:
+ request (:class:`~.cluster_service.SetNodePoolManagementRequest`):
+ The request object. SetNodePoolManagementRequest sets
+ the node management properties of a node pool.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetNodePoolManagementRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_node_pool_management,
+ default_timeout=None,
+ client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_labels(
+ self,
+ request: cluster_service.SetLabelsRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Sets labels on a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLabelsRequest`):
+ The request object. SetLabelsRequest sets the Google
+ Cloud Platform labels on a Google Container Engine
+ cluster, which will in turn set them for Google Compute
+ Engine resources used by that cluster
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ ~.cluster_service.Operation:
+ This operation resource represents
+ operations that may have happened or are
+ happening on the cluster. All fields are
+ output only.
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = cluster_service.SetLabelsRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method.wrap_method(
+ self._transport.set_labels, default_timeout=None, client_info=_client_info,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def set_legacy_abac(
+ self,
+ request: cluster_service.SetLegacyAbacRequest = None,
+ *,
+ project_id: str = None,
+ zone: str = None,
+ cluster_id: str = None,
+ enabled: bool = None,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> cluster_service.Operation:
+ r"""Enables or disables the ABAC authorization mechanism
+ on a cluster.
+
+ Args:
+ request (:class:`~.cluster_service.SetLegacyAbacRequest`):
+ The request object. SetLegacyAbacRequest enables or
+ disables the ABAC authorization mechanism for a cluster.
+ project_id (:class:`str`):
+ Deprecated. The Google Developers Console `project ID or
+ project
+ number